home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / THINK C Digest / 1992 / 92-01 next >
Text File  |  1995-12-31  |  126KB  |  3,654 lines

  1. 
  2. Path: ucivax!gateway
  3. From: sink@zorro.cecer.army.mil ("Eric W. Sink")
  4. Subject: Are direct classes useful ?
  5. Message-ID: <9201012103.AA05205@zorro.cecer.army.mil>
  6. X-Mailer: ELM [version 2.3 PL11]
  7. Newsgroups: fa.think-c
  8. Lines: 20
  9. Date: 1 Jan 92 21:04:51 GMT
  10.  
  11. I want to create a special hierarchy of classes for my application.
  12. Objects for this set of classes will always be allocated in a
  13. special region of memory, for efficiency, and the classes therefore
  14. need to be direct.  Object references will be pointers to some
  15. portion of some locked pool of memory.
  16.  
  17. Then I found out that subclasses cannot change the access specifier.
  18. Therefore, my hierarchy cannot be subclassed from CObject.  Therefore,
  19. I cannot store objects from my hierarchy in CLists or CStacks.
  20.  
  21. It would appear to me that if I want a hierarchy of direct classes,
  22. I must then write my own hierarchy of Collection classes to support
  23. the new objects.
  24.  
  25. Anyone have any insight ?
  26.  
  27. --
  28. Eric W. Sink,  Spatial Analysis and Systems Team
  29. USACERL, P.O. Box 9005, Champaign, IL 61826-9005
  30. 1-800-USA-CERL x449,   e-sink@uiuc.edu
  31. 
  32. 
  33. Path: ucivax!gateway
  34. From: alan@kaman.com (Alan Piszcz)
  35. Subject: MAILING list addition?
  36. Message-ID: <9201021144.AA06524@p1.kaman.com>
  37. Newsgroups: fa.think-c
  38. Lines: 6
  39. Date: 2 Jan 92 11:43:34 GMT
  40.  
  41. To whom it may concern:
  42.  
  43. Can you please add me to your mailing list?
  44.  
  45. Thank you.
  46.  
  47. 
  48. 
  49. Path: ucivax!gateway
  50. From: udsugar@king.mcs.drexel.edu (David Sugar)
  51. Subject: A5 ???
  52. Message-ID: <9201021316.AA15199@mcs.drexel.edu>
  53. Newsgroups: fa.think-c
  54. Lines: 18
  55. Date: 2 Jan 92 13:18:27 GMT
  56.  
  57.  
  58.   Ok, I've sorta been asking questions leading up to this in the past couple
  59. of weeks, but now I'm stuck again.  Here is what I'm doing??  I want to
  60. write a background only appe that runs on startup, but I want it to use
  61. PPC to be able to communicate to other apps (either local or network).  The
  62. PPC isn't a problem, and I can write the appe, but I can't seem to get it
  63. to register it's self when I start it as an appe in the extensions folder.
  64. I know that it is running because something like Process Watcher or Tattle
  65. Tale will show me that it has a process, but it doesn't register under PPC.
  66. I've been doing some reading and looking through code and from what I have
  67. found I think that I need to make an A5 world??  Am I correct in thinking
  68. this, will this help, am I making any sence??  If anyone has either some
  69. code or suggestions on how to do something of what I'm trying, let me know??
  70.  
  71. Thanks
  72.  
  73. Dave Sugar
  74. udsugar@mcs.drexel.edu
  75. 
  76. 
  77. Path: ucivax!gateway
  78. From: wadew@ducvax.auburn.edu (Wade Williams)
  79. Subject: Think C build order
  80. Message-ID: <B8FC5E464800409A@ducvax.auburn.edu>
  81. Newsgroups: fa.think-c
  82. Lines: 40
  83. Date: 3 Jan 92 00:24:53 GMT
  84. X-Envelope-to: think-c@ics.uci.edu
  85.  
  86. Ok, this should be a simple question:
  87.  
  88. I've asked it on Compuserve, but I want to see if anyone out there has any
  89. innovative ideas.
  90.  
  91. As I'm sure most of you know, THINK Pascal allows you to change the build
  92. order of files in the project.  Thus, with the "uses" statement, the last
  93. file in the project can use a procedure or variable declared in the first
  94. file of the project.  In particular, I've used this feature to create a
  95. "Globals" unit that contains all my global variables and procedures.
  96.  
  97. However, THINK C insists that files be built in alphabetical order.
  98. #including a globals.c file doesn't work because the variables get
  99. redeclared in every file (even using the #pragma once).
  100.  
  101. One suggestion is to put all the variables in a global file and have THAT
  102. file #include all the other files in the project.  However, someone
  103. mentioned that this "wreaks havoc" on incremental compiles.  Why, I'm not
  104. sure - can anyone verify this?
  105.  
  106. So my questions are:
  107.  
  108. 1)  How can I create a file of global variables that will be available to
  109. all files in the project?
  110.  
  111. 2)  If I want to call a procedure in another file, is simply #including the
  112. file all that is required?
  113.  
  114. BTW, this is using THINK C 5.0.1.
  115.  
  116. Thanks.
  117.  
  118. -------------------------------------------------------------------------
  119. Wade Williams                             "Any escape might help to smooth the
  120. User Services Specialist            unattractive truth, but the suburbs
  121. Academic Computing                     have no charms to soothe the restless
  122. Auburn University                      dreams of youth." (N. Peart)
  123. wadew@ducvax.auburn.edu
  124. -------------------------------------------------------------------------
  125.  
  126. 
  127. 
  128. Path: ucivax!gateway
  129. From: pmiller@topaz.bmr.gov.au (Peter Miller)
  130. Subject: Re: Think C build order
  131. X-Face: u\%{\QY_5[S37dfQ#c*#""=K,KGq>4wGryNm+=TT]1jOGap~>j*-sb9d|ll.sHIJu&n{:T`
  132.  cP|e(B?o,W%l_)o5pW,"MVie?sw{hZ@7E^o`C:wz){1p!u%O<N#lcPP]b|f:2,-mNKt{Ue(_7e"ok@
  133.  b".~TQ#YGrlY[r!:5q[/"O&Bn4:3mwuUFt>Qc]KTq}A")Jk,[
  134. Message-ID: <9201030353.AA01112@topaz.bmr.gov.au>
  135. In-Reply-To: Your message of 03 Jan 92 00:24:53 +0000.
  136.              <B8FC5E464800409A@ducvax.auburn.edu>
  137. Newsgroups: fa.think-c
  138. Lines: 136
  139. Date: 3 Jan 92 03:49:05 GMT
  140.  
  141.  
  142. Wade Williams <wadew@ducvax.auburn.edu> writes:
  143. > Ok, this should be a simple question:
  144. >
  145. > I've asked it on Compuserve, but I want to see if anyone out there has any
  146. > innovative ideas.
  147. >
  148. > As I'm sure most of you know, THINK Pascal allows you to change the build
  149. > order of files in the project.  Thus, with the "uses" statement, the last
  150. > file in the project can use a procedure or variable declared in the first
  151. > file of the project.  In particular, I've used this feature to create a
  152. > "Globals" unit that contains all my global variables and procedures.
  153. >
  154. > However, THINK C insists that files be built in alphabetical order.
  155. > #including a globals.c file doesn't work because the variables get
  156. > redeclared in every file (even using the #pragma once).
  157. >
  158. > One suggestion is to put all the variables in a global file and have THAT
  159. > file #include all the other files in the project.  However, someone
  160. > mentioned that this "wreaks havoc" on incremental compiles.  Why, I'm not
  161. > sure - can anyone verify this?
  162. >
  163. > So my questions are:
  164. >
  165. > 1)  How can I create a file of global variables that will be available to
  166. > all files in the project?
  167. >
  168. > 2)  If I want to call a procedure in another file, is simply #including the
  169. > file all that is required?
  170. >
  171. > BTW, this is using THINK C 5.0.1.
  172.  
  173. Dear Wade,
  174.  
  175. You prombelm is not unique to Think C.  Tha advantage, and disadvantage, of C
  176. is it allows you to do just about anything you like.  So writing
  177. portable code, and read able code, and any other type of code, means
  178. self-discipline in C, because the language doesn't do the discipline for you.
  179. Tools not rules, as the X11 guys say.
  180.  
  181. The simplest transition for PASCAL programmers,
  182. and a hugely useful programming model in any case,
  183. is to make the following equivalences:
  184.     UNIT fred
  185.     INTERFACE
  186.         something    <- fred.h
  187.     IMPLEMENTATION
  188.         something    <- fred.c
  189.  
  190. anywhere in PASCAL you would have said
  191.     USES fred
  192. you say
  193.     #include "fred.h"
  194. in C.
  195.  
  196. Because the .h file and the .c file are independent,
  197. the compilation order doesn't matter.
  198.  
  199. The only thing to remember is to put
  200.     #include "fred.h"
  201. at the top of fred.c, so that the prototypes and delarations in fred.h
  202. and be verified to be the same as the definitions in fred.c, by the compiler
  203. automagically.
  204.  
  205. In order to gave a file of global variables
  206. the "globals.c" file would looke something like this:
  207.     #include "globals.h"
  208.     int foo;
  209.     int bar;
  210.     int baz;
  211.  
  212.     double
  213.     sqr(double x)
  214.     {
  215.         return x * x;
  216.     }
  217. and the "globals.h" file would look something like this:
  218.     extern int foo;
  219.     extern int bar;
  220.     extern int baz;
  221.  
  222.     double foo(double);
  223. Note that the "extern" is implicit on function prototypes.
  224. You should also be aware that "extern" means "this guy exists, but is
  225. defined somewhere else".  There may be many extern declarations of
  226. the same variable, but only one definition in the entire program.
  227.  
  228. In particular, the following code is legal:
  229.     extern int foo;
  230.     int foo;
  231. which is what is actually happening in the #include "global.h" inside of
  232. thr "global.c" file.  Subsequent declarations of a variable (or function)
  233. are verified to be consistent with earlier declarations.
  234.  
  235. The reason that PASCAL has a build order is that the compiler constructs
  236. a compiled form of the INTERFACE section.  You can't USES it until this has
  237. been done.  Not so with C, where the .h file exists in its own right.
  238.  
  239. So what should go into a .h file?
  240. Exactly as much as is necessary to interface with the code in th .c file.
  241. No more.  (And obviously no less, or it is unusable.)
  242. In particular, if you can keep a symbol private to the .c file, do so,
  243. otherwise you clutter the name space and get irritating errors.
  244. [When writing libraries this is even more important, as users can't
  245. be psychic and "know" what random symbols you are going to lob into
  246. the various name spaces.  The naming convention, below, helps this too.]
  247.  
  248. Another parallel is the use of static variables and functions.
  249. These are analogous to variable and function definitions
  250. inside the IMPLEMENTATION section and not memtioned in the INTERFACE section.
  251. Use them for the same reasons.
  252.  
  253. Another convention I use is that EVERYTHING defined in fred.h has a
  254. fred_ prefix.  That way, if I'm looking at a use of fred_disembowel,
  255. i know (KNOW!) that it is in fred.c.  Also, i know (KNOW!) none of the
  256. symbol names in fred.h will collide with any other symbol in any other file.
  257. Naturally the restriction only applies to .h files,
  258. anything static to the .c file is not so restricted.
  259.  
  260. Re-reading the original questions prompts another suggestion,
  261. obvious to a long-time C programmer, but not so obvious to a beginner:
  262.     The file suffixes .c can be thought of as "dot code" and the
  263.     suffix .h as "dot header".
  264. Only .h files are ever the subject
  265. of include directives, and only .c files ever contain code.
  266. (naturally, C doesn't enforce this, tools not rules, y'know,
  267. but it sure makes the code easier to read.)
  268. [And plenty of exceptions can be found, but let's not bombard
  269. neophytes with the ugly real world just yet.]
  270.  
  271. Most imcrimental compiler schemes (and probably Think C, too) expect this
  272. convention, and thus could be expected to be
  273. confused if you #includ'ed a .c file.
  274.  
  275. Regards
  276. Peter Miller
  277. 
  278. 
  279. Path: ucivax!gateway
  280. From: kire@nada.kth.se (Jan-Erik M}ngs)
  281. Subject: Again: TCL 1.1.1, problems with scrollbars in subpanes...
  282. Message-ID: <9201031403.AA23922@nada.kth.se>
  283. Newsgroups: fa.think-c
  284. Lines: 45
  285. Date: 3 Jan 92 14:03:58 GMT
  286.  
  287. Since I got no replies on my earlier posting, I'll try again:
  288.  
  289. There seems to be a problem with panoramas that contains
  290. scrollbars within subpanes. To see the problem, look (for
  291. example) at NewClassDemo. Change the windowType of DLOG ID 1030
  292. ("String demo") to documentProc or zoomDocProc. Run NewClassDemo
  293. and select "String table demo..." from the Dialogs-menu. The
  294. dialog will now have scrollbars. Make the dialog window smaller
  295. so that only a part of the vertical scrollbar (for the list) is
  296. seen. Now scroll using the "main" vertical scroll bar
  297. (inDownButton) and see how the scrollbar belonging to the list
  298. updates.
  299.  
  300. On a color monitor (256 colors) you can easily see that the
  301. scrollbar belonging to the list is not drawn properly, it is
  302. drawn on top of the main scrollbar. This happens in
  303. CControl::Offset when the scrollbar is moved with MoveControl. I
  304. have not had the time to track down the problem any further.
  305.  
  306. On a monochrome screen, the scrollbar only _sometimes_ look
  307. wrong. But if you change hStep and vStep in CScrollPane and do
  308. the same test, you will definitely see the problem. To do this,
  309. comment out the line [marked (**)] in CDialog::MakePanorama
  310. below (without this line, hStep and vStep will have their
  311. default values):
  312. .
  313. .
  314. if (fHasHScroll || fHasVScroll || fHasSizeBox) {
  315.     scrollPane = new( CScrollPane);
  316.     scrollPane->IScrollPane( this, this, 0, 0, 0, 0, sizELASTIC, sizELASTIC,
  317.                     fHasHScroll, fHasVScroll, fHasSizeBox);
  318.     scrollPane->FitToEnclFrame( TRUE, TRUE);
  319. //(**)    scrollPane->SetSteps( kScrollSteps, kScrollSteps);
  320.     scrollPane->SetID( kDialogScrollPaneID);
  321.  
  322. Has anyone else seen this problem and can confirm it? Any
  323. workarounds? I'd like to have my windows set up like this. By
  324. the way, TCL 1.1 for Pascal also have the same problem.
  325.  
  326. Another thing, any news on the problems with exception handling
  327. and register allocation? That problem was not fixed in 1.1.1.
  328.  
  329. Thanks
  330.  
  331.     Kire
  332. 
  333. 
  334. Path: ucivax!gateway
  335. From: wadew@ducvax.auburn.edu (Wade Williams)
  336. Subject: Thanks...
  337. Message-ID: <2BE6AADE880052BA@ducvax.auburn.edu>
  338. Newsgroups: fa.think-c
  339. Lines: 14
  340. Date: 3 Jan 92 14:07:38 GMT
  341. X-Envelope-to: think-c@ics.uci.edu
  342.  
  343. Many thanks to those who responded to my question about THINK C build
  344. order.
  345.  
  346. I was pretty proficient in Pascal, but I'm quickly learning what you
  347. already know - C is a completely different creature.
  348.  
  349. -------------------------------------------------------------------------
  350. Wade Williams                             "Any escape might help to smooth the
  351. User Services Specialist            unattractive truth, but the suburbs
  352. Academic Computing                     have no charms to soothe the restless
  353. Auburn University                      dreams of youth." (N. Peart)
  354. wadew@ducvax.auburn.edu
  355. -------------------------------------------------------------------------
  356.  
  357. 
  358. 
  359. Path: ucivax!gateway
  360. From: cmiller@laurel (Craig Miller)
  361. Subject: Re:  Are direct classes useful ?
  362. Message-ID: <9201031657.AA22876@laurel.umass.edu>
  363. Newsgroups: fa.think-c
  364. Lines: 37
  365. Date: 3 Jan 92 16:53:58 GMT
  366.  
  367. Eric W. Sink (sink@zorro.cecer.army.mil) writes:
  368.  
  369. > I want to create a special hierarchy of classes for my application.
  370. > Objects for this set of classes will always be allocated in a
  371. > special region of memory, for efficiency, and the classes therefore
  372. > need to be direct.  Object references will be pointers to some
  373. > portion of some locked pool of memory.
  374. >
  375. > Then I found out that subclasses cannot change the access specifier.
  376. > Therefore, my hierarchy cannot be subclassed from CObject.
  377. Therefore,
  378. > I cannot store objects from my hierarchy in CLists or CStacks.
  379. >
  380. > It would appear to me that if I want a hierarchy of direct classes,
  381. > I must then write my own hierarchy of Collection classes to support
  382. > the new objects.
  383.  
  384. As far as I can tell your assertion is correct.  The Think C object
  385. extensions are just not flexible enough to have a parent class be
  386. indirect and the child class be direct.  Think about what would
  387. happen if the parent class accesses its instance variable indirectly
  388. and the child class accesses the same instance variable directly.
  389. Code which uses the class may call methods which access the variable
  390. directly, or other methods which access the same variable indirectly.
  391. The compiled code for from one file or the other would have to be
  392. incorrect.
  393.  
  394. You could recompile the TCL as direct objects only if there were no
  395. assumptions about objects being implemented as handles.  This is
  396. probably not the case.
  397.  
  398. -----------------------------------------------------------------------
  399. Craig D. Miller, Computer Programmer          \  cmiller@math.umass.edu
  400. Scientific Reasoning Research Institute (SRRI) \      tel. 413-545-5865
  401. 306 Hasbrouck Lab                               \
  402. University of Massachusetts, Amherst, MA  01003  \                  USA
  403. -----------------------------------------------------------------------
  404. 
  405. 
  406. Path: ucivax!gateway
  407. From: wadew@ducvax.auburn.edu (Wade Williams)
  408. Subject: Global #defines
  409. Message-ID: <60AA56BC88005E90@ducvax.auburn.edu>
  410. Newsgroups: fa.think-c
  411. Lines: 21
  412. Date: 3 Jan 92 20:27:48 GMT
  413. X-Envelope-to: think-c@ics.uci.edu
  414.  
  415. Ok, sorry for these simplistic questions, but I've got one more:
  416.  
  417. Is it possible to have a global #define such as:
  418.  
  419. #define    NIL                    (Ptr)0L
  420. #define    MOVE_TO_FRONT        (WindowPtr)-1L
  421.  
  422.  
  423.  
  424. Using the scenario presented in my previous post, where would it go, in
  425. Globals.c or Globals.h?
  426.  
  427. Thanks.
  428. -------------------------------------------------------------------------
  429. Wade Williams                             "Any escape might help to smooth the
  430. User Services Specialist            unattractive truth, but the suburbs
  431. Academic Computing                     have no charms to soothe the restless
  432. Auburn University                      dreams of youth." (N. Peart)
  433. wadew@ducvax.auburn.edu
  434. -------------------------------------------------------------------------
  435.  
  436. 
  437. 
  438. Path: ucivax!gateway
  439. From: mead@informatics.wustl.edu (Charles Mead)
  440. Subject: Initialization of arrays
  441. Message-ID: <9201032051.AA16223@informatics.WUstl.EDU>
  442. Newsgroups: fa.think-c
  443. Lines: 16
  444. Date: 3 Jan 92 20:53:33 GMT
  445.  
  446.  
  447. I'm sure I must be doing something trivially wrong, but I seem to have encountered a bug in the way that Think C initializes arrays.  Specifically, if the
  448. array has only 2 elements in it (arrays in question are of type 'char') and
  449. if the array is initialized at declaration (e.g. char word6[] = { 'a', 't', '\0'} and if the array is initialized as part of the initialization of several
  450. similar arrays (i.e. suppose 3 arrays of type char are all declared and
  451. initialized in one piece of code), THink C seems to be unable to correctly
  452. insert the termination character for the 2-character-length array.
  453.  
  454. Has anybody heard of this bug or should I figure that I'm really missing
  455. something obvious.  I have stepped through in the debugger and the incorrect
  456. action definitely occurs at declaration, i.e. the array isn't begin written
  457. over at some later point in the program.  I am running 4.0
  458.  
  459. Thanks for the help.
  460.  
  461. charlie mead
  462. 
  463. 
  464. Path: ucivax!gateway
  465. From: wadew@ducvax.auburn.edu (Wade Williams)
  466. Subject: #$! Prototypes!
  467. Message-ID: <8A78316B480068BC@ducvax.auburn.edu>
  468. Newsgroups: fa.think-c
  469. Lines: 43
  470. Date: 4 Jan 92 01:24:26 GMT
  471. X-Envelope-to: think-c@ics.uci.edu
  472.  
  473. Ok, last question (you don't believe that do you?):
  474.  
  475. If I have my function protyped as:
  476.  
  477. void DoMenu(EventRecord *gtheEvent);
  478.  
  479. called as:
  480.  
  481. DoMenu(>heEvent);
  482.  
  483. and declared as:
  484.  
  485. void DoMenu(EventRecord *gtheEvent)
  486. {
  487. some code...
  488. }
  489.  
  490. with the variable declared as:
  491.  
  492. EventRecord gtheEvent;
  493.  
  494. why do I get a "argument to function does not match prototype" error?  The
  495. way I see it, I'm passing it a pointer to an event record, and I specify in
  496. the prototype that it will be receiving a pointer to an event record.  I
  497. have turned off strict prototype enforcement, but it doesn't help.
  498.  
  499. I understood why I had to call get new window with:
  500.  
  501. GetNewWindow(128, NIL, (WindowPtr)-1);
  502.  
  503. But I don't see what I'm doing wrong on this one.
  504.  
  505. Again, I apologize for my ignorance..I just don't have any Mac C
  506. programmers around here.
  507.  
  508. -------------------------------------------------------------------------
  509. Wade Williams                             "Any escape might help to smooth the
  510. User Services Specialist            unattractive truth, but the suburbs
  511. Academic Computing                     have no charms to soothe the restless
  512. Auburn University                      dreams of youth." (N. Peart)
  513. wadew@ducvax.auburn.edu
  514. -------------------------------------------------------------------------
  515.  
  516. 
  517. 
  518. Path: ucivax!gateway
  519. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  520. Subject: Initialization of arrays
  521. Message-ID: <9201040139.AA00607@chaos.cs.brandeis.edu>
  522. In-Reply-To: Charles Mead's message of 3 Jan 92 20:53:33 GMT <9201032051.AA16223@informatics.WUstl.EDU>
  523. Newsgroups: fa.think-c
  524. Lines: 35
  525. Date: 4 Jan 92 01:39:27 GMT
  526.  
  527. >> On 3 Jan 92 20:53:33 GMT, Charles Mead <mead@informatics.wustl.edu> said:
  528.  
  529.  > I'm sure I must be doing something trivially wrong, but I seem to
  530.  > have encountered a bug in the way that Think C initializes arrays.
  531.  > Specifically, if the array has only 2 elements in it (arrays in
  532.  > question are of type 'char') and if the array is initialized at
  533.  > declaration (e.g. char word6[] = { 'a', 't', '\0'} and if the array
  534.  > is initialized as part of the initialization of several similar
  535.  > arrays, Think C seems to be unable to correctly insert the
  536.  > termination character for the 2-character-length array.
  537.  
  538. This is correct; there is a bug in THINK C 4.0.x in the code that's
  539. generated to initialize stack-based (auto) character arrays. The code
  540. that THINK C 4.0 produces assumes that the array is placed at an
  541. even-word boundry, and that it's of even length. This is sometimes not
  542. the case, and incorrect code is produced.
  543.  
  544. To work around this problem in C 4.0, either:
  545.  
  546. - always use pointers instead of arrays
  547.     char *word6 = "at";
  548.  
  549. - declare your arrays static
  550.     static char word6[] = "at";
  551.  
  552. - initialize the array yourself, using a function call
  553.     char word6[3]; strcpy(word6, "at");
  554.  
  555. This bug is fixed in THINK C 5.0.
  556.  
  557.     -phil
  558. ----
  559.    Phil Shapiro                           Technical Support Analyst
  560.    Language Products Group                     Symantec Corporation
  561.         Internet: phils@chaos.cs.brandeis.edu
  562. 
  563. 
  564. Path: ucivax!gateway
  565. From: blake@seagull.math.byu.edu (Blake Fordham)
  566. Subject: color off-screen graphics
  567. Message-ID: <9201040501.AA13853@seagull.math.byu.edu>
  568. Newsgroups: fa.think-c
  569. Lines: 1
  570. Date: 4 Jan 92 05:02:21 GMT
  571.  
  572. myAsk
  573. 
  574. 
  575. Path: ucivax!gateway
  576. From: bdugan@gnu.ai.mit.edu (Bill Dugan)
  577. Subject: (none)
  578. Message-ID: <9201040948.AA11563@apple-gunkies.gnu.ai.mit.edu>
  579. Newsgroups: fa.think-c
  580. Lines: 1
  581. Date: 4 Jan 92 09:48:30 GMT
  582.  
  583. unsubscribe
  584. 
  585. 
  586. Path: ucivax!gateway
  587. From: blake@seagull.math.byu.edu (Blake Fordham)
  588. Subject: off-screen graphics
  589. Message-ID: <9201041945.AA14045@seagull.math.byu.edu>
  590. Newsgroups: fa.think-c
  591. Lines: 20
  592. Date: 4 Jan 92 19:47:04 GMT
  593.  
  594. Sorry about the last message, I missed typed and didn't catch it until too
  595. late.  Anyway, here's my question:
  596.  
  597.   I'm still working on setting up an off-screen graphic, but I recently
  598. got my update to C 5.0, so I thought I would try to use TCL.  So far, I'm
  599. happy with the results, but I've run into a problem.  I have a 2D array of
  600. short ints that correspond to PICTs in the res file;  I want to display
  601. the PICT (all are the same size) in a tiled arrangement reflecting the
  602. array.  I can do it with CBitMap and CBitMapPane objects, and it looks
  603. great and update invisibly, but I need to display the picts in color not
  604. BW.  I want to be able to chnge the array in response to the user and have
  605. the PICTs change accordingly.  Do I need to build a GWorld version of CBitMap
  606. or is there an easier solution?  I thought about attaching an array of CPicture
  607. objects to the document object, but will this react quickly enough, and how
  608. do I set the itsGopher instance in MyDoc::BuildWindow()?  I want the window
  609. to beable to detect mouse events in the individual picts.  Anyone have any
  610. idea of what is the best solution?  I'd appreciate any input.
  611.  
  612. Blake Fordham
  613. blake.seagull.math.byu.edu
  614. 
  615. 
  616. Path: ucivax!gateway
  617. From: eidlheit@bimacs.cs.biu.ac.il (Gadi Eidelheit)
  618. Subject: (none)
  619. Message-ID: <9201050746.AA06283@bimacs.cs.biu.ac.il>
  620. Comments: Internet address: bimacs.cs.biu.ac.il. Bitnet address: bimacs.bitnet.
  621.      Old internet address (bimacs.biu.ac.il) is available only temporarily.
  622. Newsgroups: fa.think-c
  623. Lines: 2
  624. Date: 5 Jan 92 07:46:15 GMT
  625.  
  626. Please add me to the mailing list...
  627. thanks Gadi Eidelheit
  628. 
  629. 
  630. Path: ucivax!gateway
  631. From: comqpk@hatfield.ac.uk (Peter Kay)
  632. Subject: How difficult is my problem?
  633. Message-ID: <12479.9201060810@infsc1.hatfield.ac.uk>
  634. Newsgroups: fa.think-c
  635. Lines: 64
  636. Date: 6 Jan 92 09:35:09 GMT
  637.  
  638.  
  639. Although I have been scanning this list for some time, this is my first
  640. request for information. I hope that you will make allowances if the
  641. question is very stupid. I am fairly new at C programming and even more
  642. of a beginner in programming for the Mac environment.  I have been
  643. wrestling with a particular problem for some time.
  644.  
  645. I am doing a research project which involves the use of the Voice
  646. Navigator (VN) speech recogniser on a Mac IIcx and using System 7.0.
  647. The VN software includes facilities for the creation of "language
  648. files" which allows one to use existing applications with speech-only
  649. input, e.g. MacDraw II.
  650.  
  651. One of the difficulties with the VN software is that the slowest
  652. speech-controlled cursor movement is too fast for my purposes.  My
  653. calculations are (by timing cursor movement accross a 19" screen) that
  654. the rate of cursor movement is 1 pixel per tick.  The VN software
  655. allows one to write Voice Extensions (VXTN) in C, Pascal, or assembly
  656. language. Since I have Think C 5.0.1, I would like to attempt to write
  657. a VXTN which would slow down the cursor to 1/10th (say) of the above
  658. speed.
  659.  
  660. The  main VN software is in the form of a driver and all text input
  661. (created by speech input) is entered into a queue by the recognition
  662. portion of the driver, then independently pulled off the queue either
  663. at GetNextEvent time or during driver runtime. The VN manual states
  664. that "when writing a VXTN, you cannot be assured that the operating
  665. system will still be in the same state as when you queued the output
  666. string. Your application may no longer be the front application; the
  667. stack and A5 could be different.  Therefore, your VXTN will have to set
  668. up any globals it needs, and if the executed actions involve callbacks
  669. to your application, the VXTN should check to see if your application
  670. is actually running."  Apparently, there is no problem with VXTN making
  671. calls that move memory since the driver does all of its processing at
  672. well defined times. Also, the driver is re-entrant, so that the VXTN
  673. can make immediate calls back to the driver and can even put up a modal
  674. dialogue to interact with the user.  The manual also gives details of a
  675. VoiceControl header file in terms of specific definitions and
  676. structures (in C).
  677.  
  678. My main question is this:-
  679.  
  680. Would I be tackling something that is well and truly above my
  681. head or can the problem be solved by a relatively trivial piece of
  682. code? .... or is it somewhere in between?
  683.  
  684. If not "over my head", I would be very grateful for any pointers in the
  685. right direction. For example, what are the primary toolbox routines
  686. with which I should be concerned?  Also, am I correct in thinking that
  687. the functions connected with the movement of the cursor are completely
  688. independent of whether the (speech controlled) mouse button is down or
  689. up?
  690.  
  691. I have access to Inside Macintosh (I - V), Macintosh Revealed, Mark's
  692. Macintosh Programming Primers (I - II) and, of course, Think C manuals.
  693.  
  694. I have put in many, many hours of trying to solve this problem (even by
  695. very indirect methods) before resorting to this PLEA FOR HELP!
  696.  
  697.  
  698. Peter Kay,  Division of Computer Science,   Hatfield Polytechnic
  699. Hatfield, Herts, U.K.   AL10 9AB  ---------  tel.no. 07072 79358
  700. INTERNET(USA):   comqpk%hatfield.ac.uk@forsythe.stanford.edu
  701. JANET: comqpk@uk.ac.hatfield  BITNET/EARN: comqpk%hatfield.ac.uk@ukacrl
  702. 
  703. 
  704. Path: ucivax!gateway
  705. From: nick@dcs.edinburgh.ac.uk (Nick Rothwell)
  706. Subject: Bug in TC5.0.1 Compiler....
  707. Message-ID: <9201061334.aa07697@dcs.ed.ac.uk>
  708. Newsgroups: fa.think-c
  709. Lines: 9
  710. Date: 6 Jan 92 15:40:38 GMT
  711.  
  712. ...i.e. in the application's operation itself rather than what it does.
  713. TC5.0.1 disables QUIT when it's running something - this makes sense - but
  714. can still be closed down from the Finder. Nothing bad seems to happen
  715. unless the project is running under the debugger. Then, if the Finder
  716. shutdown procedure happens to close down the compiler before the project,
  717. the project and debugger are still there, and anarchy ensues.
  718.  
  719.         Nick.
  720.  
  721. 
  722. 
  723. Path: ucivax!gateway
  724. From: nick@dcs.edinburgh.ac.uk
  725. Subject: ARCHIVE: THINK Back 1.0 Extension
  726. Message-ID: <20646.9201061344@rockall.dcs.ed.ac.uk>
  727. In-Reply-To: Mark Nagel's message of 26 Dec 91 15:58:00 GMT <13368.693763068@ics.uci.edu>
  728. Newsgroups: fa.think-c
  729. Lines: 9
  730. Date: 6 Jan 92 15:40:46 GMT
  731.  
  732. >but I'm sure that some bugs still
  733. >remain; please email any to me.
  734.  
  735. The only thing I've noticed is that it occasionally hangs when it's finished
  736. with a source file and I've been flipping around between applications. When
  737. it hangs there's no clean recovery procedure, although an ExitToShell from
  738. MacsBug seems fairly harmless to the project.
  739.  
  740.     Nick.
  741. 
  742. 
  743. Path: ucivax!gateway
  744. From: DNEBING@opie.bgsu.edu ("Mr. Neb")
  745. Subject: ProcPtr parameters
  746. Message-ID: <01GEZWT3VGO000029L@opie.bgsu.edu>
  747. X-VMS-Cc: DNEBING
  748. Newsgroups: fa.think-c
  749. X-VMS-To: IN%"think-c@ics.uci.edu"
  750. Lines: 15
  751. Date: 6 Jan 92 22:11:38 GMT
  752. X-Envelope-to: think-c@ics.uci.EDU
  753.  
  754.  
  755.     I want to know about ProcPtr parameters.  I understand that to pass
  756. them to the toolbox one must define the procedure as a pascal function.
  757. That much is easy.
  758.     What I want to do is to pass a procedure to one of my own procedures,
  759. more or less passing a filter function to a standard procedure.  As far as
  760. passing the procedure, that is not a problem.  The problem comes when I try
  761. to reference the procedure.  I have tried many different ways, but at most
  762. think-c is telling me that I am making a call to a null function, or something
  763. like that.
  764.     Could someone clear up this problem that I have?  If so, I offer
  765. thanks in advance.
  766.  
  767.     dnebing@opie.bgsu.edu
  768.  
  769. 
  770. 
  771. Path: ucivax!gateway
  772. From: halam1@ub.d.umn.edu ("Haseen I. Alam")
  773. Subject: question regarding IUTimeString
  774. Message-ID: <9201070426.AA17260@ub.d.umn.edu>
  775. X-Mailer: ELM [version 2.3 PL11]
  776. Newsgroups: fa.think-c
  777. Lines: 41
  778. Date: 7 Jan 92 04:25:41 GMT
  779.  
  780.  
  781.  Hi again,
  782.  
  783.     First of all, many thanks to Thomas and Kirk Swenson for helping me with
  784.     my previous set of questions.  It turns out, the menu ID's were not set
  785.     properly in ResEdit 2.1, so I set them Using ResEdit 1.2 (don't ask me
  786.     why).  It is interesting how you get 2.1 by swapping the digits in 1.2!!!
  787.     (don't ask me this either).
  788.  
  789.     Anyway, now the menus are drawn and I can change the font and style from
  790.     their sub menus and the change show up on my little window.  COOL!  But
  791.     for some reason IUTimeString does not return a valid string.  So if I
  792.     comment out the call to this routine and just print a constant string,
  793.     then the Timer program in Mac Programming Primer Vol 1 works.  I used the
  794.     debugger to print the value of myTimeString after the call to
  795.     IUTimeString and it prints ???.  The vars are defines as follows, the
  796.     first two are globals and the third is local to DrawClock, which contains
  797.     the call to IUTimeString.
  798.  
  799.         #define     INCLUDE_SECONDS        TRUE
  800.         long int    gCurrentTime ;
  801.         Str255        myTimeString ;
  802.  
  803.     First, gCurrentTime is set by a call to GetDateTime, then IUTimeString is
  804.     called to "get the current time in a format suitable for display."  The
  805.     calls to these two routines are as follows:
  806.  
  807.         GetDateTime (&gCurrentTime) ;
  808.         IUTimeString (gCurrentTime, INCLUDE_SECONDS, myTimeString ) ;
  809.  
  810.     But the value that I get back from IUTimeString is garbage (I don't know
  811.     why).  Yes, I guess I should get IM, but kinda short of money at this time.
  812.     So I ordered THINK Reference, which is supposed to be an electronic version
  813.     of IM 1-5 (kinda!).  But till then if someone could help me solve this
  814.     mystery I would really appreciate the favour.  Thanks in advance.
  815.  
  816.  Haseen.
  817.  .-------------------------------------------------------------------------.
  818.  | "If you think I am expensive, wait  | email: halam1@ub.d.umn.edu        |
  819.  |     till you hire an amateur!"      |    or  st0404@AppleLink.Apple.Com |
  820.  `-------------------------------------------------------------------------'
  821. 
  822. 
  823. Path: ucivax!gateway
  824. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  825. Subject: ARCHIVE: THINK Back 1.0 Extension
  826. Message-ID: <9201071244.AA10212@chaos.cs.brandeis.edu>
  827. In-Reply-To: nick@dcs.edinburgh.ac.uk's message of 6 Jan 92 15:40:46 GMT <20646.9201061344@rockall.dcs.ed.ac.uk>
  828. Newsgroups: fa.think-c
  829. Lines: 31
  830. Date: 7 Jan 92 12:46:31 GMT
  831.  
  832. Hi Nick,
  833.  
  834. >>>>> On 6 Jan 92 15:40:46 GMT, nick@dcs.edinburgh.ac.uk said:
  835.  
  836.  > The only thing I've noticed is that it occasionally hangs when it's
  837.  > finished with a source file and I've been flipping around between
  838.  > applications. When it hangs there's no clean recovery procedure,
  839.  > although an ExitToShell from MacsBug seems fairly harmless to the
  840.  > project.
  841.  
  842. The problem seems to be this: if you start a compile, put it into the
  843. background, obscure the project window in some way, then bring think c
  844. in the foreground by clicking on the project window, *and* the
  845. obscured part of the project window hasn't yet been redrawn, then an
  846. infinite loop occurs. I think that my patch code is missing a resume
  847. event from the toolbox, so it's ignoring events that should be passed
  848. on to THINK C. (This is definitely the problem.)
  849.  
  850. The problem doesn't seem to happen when I don't have CMaster
  851. installed; it's possible that our GNE hooks are interfering in some
  852. way.
  853.  
  854. Due to the way that the THINK C project update works, your projects
  855. should never get corrupted by doing an ES in MacsBug at this point (at
  856. least I've never had a problem...).
  857.  
  858.     -phil
  859. ----
  860.    Phil Shapiro                           Technical Support Analyst
  861.    Language Products Group                     Symantec Corporation
  862.         Internet: phils@chaos.cs.brandeis.edu
  863. 
  864. 
  865. Path: ucivax!gateway
  866. From: gross@kaman.com (Mark Gross)
  867. Subject: Please remove this user
  868. Message-ID: <9201071442.AA14133@lenny.kaman.com>
  869. Newsgroups: fa.think-c
  870. Lines: 12
  871. Date: 7 Jan 92 14:40:47 GMT
  872.  
  873.  
  874.  
  875.     Could you please remove this user from your mailing list.  He has left
  876.     our company and no longer has access to his email.
  877.  
  878.  
  879.     Darin S. Lory
  880.     System Administrator
  881.     Kaman Sciences Corporation
  882.     Utica, New York
  883.     <darin@kaman.com>  or  <postmaster@kaman.com>
  884.  
  885. 
  886. 
  887. Path: ucivax!gateway
  888. From: wadew@ducvax.auburn.edu (Wade Williams)
  889. Subject: Window or Dialog?
  890. Message-ID: <815957EC84005896@ducvax.auburn.edu>
  891. Newsgroups: fa.think-c
  892. Lines: 23
  893. Date: 7 Jan 92 19:56:57 GMT
  894. X-Envelope-to: think-c@ics.uci.edu
  895.  
  896. Several places I've seen recommendations that the dialog manager only be
  897. used for user input.  That is to say, it should not be used for major tasks
  898. and the Window manager should be used for such.
  899.  
  900. I want to implement a message window that has several static text fields, a
  901. few buttons and of course, an edit text field for entering the message.
  902. Naturally, the Dialog manager *seems* to be the natural way (and easiest)
  903. to do this, but again, some advise that it was never intended for that type
  904. of task.
  905.  
  906. No message will be over 32K, so I'll just be using TextEdit.  What do you
  907. think?  Would the Dialog manager be sufficient, or should I use the Window
  908. Manager even though it means writing much of the code for button and field
  909. maintenance myself?
  910.  
  911. -------------------------------------------------------------------------
  912. Wade Williams                             "Any escape might help to smooth the
  913. User Services Specialist            unattractive truth, but the suburbs
  914. Academic Computing                     have no charms to soothe the restless
  915. Auburn University                      dreams of youth." (N. Peart)
  916. wadew@ducvax.auburn.edu
  917. -------------------------------------------------------------------------
  918.  
  919. 
  920. 
  921. Path: ucivax!gateway
  922. From: cschick@chemistry.umass.edu
  923. Subject: MacIntalk query
  924. Message-ID: <920107170158995-MTASATURN*cschick@CHEMISTRY.umass.edu>
  925. P1-Message-ID: US*UMASSMAIL*UMASS; 920107170158995-MTASATURN
  926. X400-Trace: US*UMASSMAIL*UMASS; arrival Tue, 7 Jan 92 17:07:07 -0500 action
  927.  Relayed
  928. Newsgroups: fa.think-c
  929. UA-Content-ID: 920107170158995-
  930. Lines: 10
  931. Date: 7 Jan 92 22:08:27 GMT
  932.  
  933. Hello,
  934. I'm interested in speech syntesis using MacIntalk (I'm interested in any
  935. program/code that does speech synthesis on the Mac using text). I have the
  936. program, some stacks that use it, and some code that uses it, but in all cases
  937. there is no real info about the program. I would like to know if anyone knows
  938. where I can find info on MacIntalk and even info on speech generation on the
  939. Mac, so I can use it and abuse it.
  940. I thank you in advance,
  941. Charlie Schick
  942. cschick@chemistry.umass.edu
  943. 
  944. 
  945. Path: ucivax!gateway
  946. From: sidar@complex.is (Sigurdur Darri Skulason)
  947. Subject: vt102-emulator / comm toolbox
  948. Message-ID: <9201080100.AA00826@complex.is>
  949. X-Mailer: ELM [version 2.3 PL11]
  950. Newsgroups: fa.think-c
  951. X-Charset: ASCII
  952. Lines: 23
  953. Date: 8 Jan 92 01:01:22 GMT
  954. X-Char-Esc: 29
  955.  
  956.  
  957.   Thanks to those who answered my enquery about a tcp tool for the
  958. Macintosh Communication Toolbox. Apparently, there is no such tool as of now.
  959. Therefore the choice now stands between writing one on our own or
  960. just abort the ctb and write the mactcp interface routines ourselves and
  961. I suppose that is what we will do.  However, one of the main reasons for
  962. choosing the ctb was the availability of a vt102 emulator in it.
  963.  If we will skip the ctb, then we will therefore need to write some vt-102
  964.  emulating code, which wouldn't be a problem if I could only find some
  965. information about that standard. That has however proved itself to be
  966. strangely difficult, considering the widespread use of that standard.
  967. Therefore, if you do have a table of the control codes or some sample
  968. code, then I would really appreciate it, if you could email it to me.
  969.  
  970.    Thanks in advance,
  971.           -sidar.
  972.  
  973. ------------------------------------------------------------
  974. Sigurdur Darri Skulason                   sidar@complex.is
  975. President, Hugsun inc.
  976. Tecnhological Park
  977. Dunhagi 5, IS-107 Reykjavik, Iceland
  978.  
  979. 
  980. 
  981. Path: ucivax!gateway
  982. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  983. Subject: Re: vt102-emulator / comm toolbox
  984. Message-ID: <199201110509.AA06511@tarski.cogsci.uiuc.edu>
  985. X-Mailer: Eudora [version 1.3a11 CTB]
  986. Newsgroups: fa.think-c
  987. Lines: 17
  988. Date: 11 Jan 92 05:09:52 GMT
  989.  
  990. I must have missed your original posting.
  991.  
  992. >  Thanks to those who answered my enquery about a tcp tool for the
  993. >Macintosh Communication Toolbox. Apparently, there is no such tool as of now.
  994.  
  995. There is a TCP/IP tool available from Advanced Software Concepts, a french
  996. company. I know that Pacer has licensed it for PacerTerm.
  997.  
  998. I would stick to the CTB if at all possible.
  999.  
  1000. pr
  1001. --
  1002. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1003. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1004. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1005. Internet: resnick@cogsci.uiuc.edu
  1006.  
  1007. 
  1008. 
  1009. Path: ucivax!gateway
  1010. From: mkelly@cs.uoregon.edu ("(Michael A. Kelly)" )
  1011. Subject: When should I avoid breaking into the Think Debugger?
  1012. Message-ID: <9201130209.AA25717@dogmatix.cs.uoregon.edu>
  1013. Newsgroups: fa.think-c
  1014. Lines: 34
  1015. Date: 13 Jan 92 02:08:33 GMT
  1016.  
  1017.  
  1018.  
  1019.  
  1020. Are there any points in a typical Mac application when I should avoid
  1021. breaking into the Think Debugger?  Suppose, for instance, that the program
  1022. is in the process of displaying a modal dialog, and I break into the Think
  1023. Debugger and step through the code.  Could there be any side effects from
  1024. doing this that could affect other programs, or the system?
  1025.  
  1026.  
  1027. The debugger in question is the Think C Debugger 5.0.1.
  1028.  
  1029.  
  1030. I ask, of course, because I've been having problems.  I usually have to
  1031. restart after a session with the debugger because the debugger seems to
  1032. release a virus into the system as it quits.  Everything's fine until I
  1033. quit the application/debugger and then I usually have just enough time to
  1034. quit all the running applications and restart before the machine crashes.
  1035. Pretty frustrating.
  1036.  
  1037.  
  1038. So, anyone have any ideas?
  1039.  
  1040.  
  1041. Thanks,
  1042.  
  1043.  
  1044. Mike.
  1045. _____________________________________________________________________________
  1046. Michael A. Kelly                                         University of Oregon
  1047. mkelly@cs.uoregon.edu                             Computer Science Department
  1048. _____________________________________________________________________________
  1049. "Never test for a bug you don't know how to fix."
  1050.         - anonymous
  1051. 
  1052. 
  1053. Path: ucivax!gateway
  1054. From: udsugar@king.mcs.drexel.edu (David Sugar)
  1055. Subject: SFFile Structure
  1056. Message-ID: <9201130355.AA04502@mcs.drexel.edu>
  1057. Newsgroups: fa.think-c
  1058. Lines: 27
  1059. Date: 13 Jan 92 03:58:23 GMT
  1060.  
  1061.  
  1062.   Ok, this is probabily a fairly simple question so I expect some responces..
  1063. Anyway, I'm working on a background only appe ("Drag and Drop" thing) that
  1064. will convert a PICT file into a PICT resource.  My first question is how
  1065. can I build a SFFile rec for when I open a resource file to stick my output
  1066. file into.  Since it's a background only appe there won't be any interface
  1067. and so I won't be asking the user for a file name to output into.  Is there
  1068. a simple way to manualy build this record to the same path that the appe
  1069. is in.  So the output file will be in the same folder as the appe that
  1070. created it.
  1071.  
  1072.   Ok, also while I'm mail you all, where do I get the name of the file that
  1073. is actually dropped onto the appe??  Like when a user dropps some PICT file
  1074. on my appe where does the appe get the file name and path of the that file?
  1075. do you use something like   main(argc,argv)  ??  or is there something
  1076. special to use??
  1077.  
  1078.   And finally, I'm planning on using the WritePartialResource call so I don't
  1079. have to read in the entire PICT into memory and then put it in the resource.
  1080. Is there anything tricky that I should be aware of when I start getting into
  1081. that part??
  1082.  
  1083. Thaks,
  1084.  
  1085. Dave Sugar
  1086. udsugar@mcs.drexel.edu
  1087.  
  1088. 
  1089. 
  1090. Path: ucivax!gateway
  1091. From: James.W.Matthews@dartmouth.edu
  1092. Subject: Re: SFFile Structure
  1093. Message-ID: <428642@prancer.Dartmouth.EDU>
  1094. Newsgroups: fa.think-c
  1095. Lines: 21
  1096. Date: 13 Jan 92 14:29:29 GMT
  1097.  
  1098. --- David Sugar wrote:
  1099. Anyway, I'm working on a background only appe ("Drag and Drop" thing) that
  1100. will convert a PICT file into a PICT resource.
  1101. --- end of quoted material ---
  1102.  
  1103. Apparently there's no such thing as a drag-and-drop 'appe'; 'appe' files are
  1104. only launched at startup.  The Apple line is that applications that accept
  1105. dragged files can not be "faceless".  So you should put together a minimal
  1106. user interface (such as a progress window that tells the user what's going on,
  1107. and lets the user switch to another application).  You get the names of the
  1108. "input" files by handling the 'ODOC' AppleEvent (see the AppleEvent chapter of
  1109. IM VI) under system 7 and using GetAppFile() for compatibility with earlier
  1110. systems (see the Segment Loader chapter of IM II).
  1111.  
  1112. You can get a reference to the working directory that your app is in by
  1113. calling GetVol() before any calls to SetVol().
  1114.  
  1115. Hope this helps,
  1116.  
  1117. Jim Matthews
  1118. Dartmouth Software Development
  1119. 
  1120. 
  1121. Path: ucivax!gateway
  1122. From: holla%monique@gatech.edu (Craig Hollabaugh)
  1123. Subject: Re:  When should I avoid breaking into the Think Debugger?
  1124. Message-ID: <9201131647.AA29469@monique.adgrp.gatech.edu>
  1125. Newsgroups: fa.think-c
  1126. Lines: 11
  1127. Date: 13 Jan 92 16:50:55 GMT
  1128.  
  1129. >> Are there any points in a typical Mac application when I should avoid
  1130. >> breaking into the Think Debugger?
  1131.  
  1132. Here is a debugging tip: Don't single step across Event functions. I found
  1133. that AcceptHighLevelEvent doesn't return appropriate values if you stop
  1134. before it and step across. Other Event functions probably behave similiarly.
  1135. So my tip is put your stops after Event functions.
  1136.  
  1137. Craig Hollabaugh
  1138. Analog Microelectronics, Georgia Tech
  1139. holla@monique.adgrp.gatech.edu
  1140. 
  1141. 
  1142. Path: ucivax!gateway
  1143. From: jjch@uranie.ais.berger-levrault.fr (John J Chew)
  1144. Subject: Re:  When should I avoid breaking into the Think Debugger?
  1145. Message-ID: <9201131625.AA09417@uranie.AIS.Berger-Levrault.FR>
  1146. Newsgroups: fa.think-c
  1147. Lines: 17
  1148. Date: 13 Jan 92 17:30:34 GMT
  1149.  
  1150. In message <9201130209.AA25717@dogmatix.cs.uoregon.edu>, Michael A. Kelly
  1151.   <mkelly@cs.uoregon.edu> writes:
  1152.  
  1153. > Are there any points in a typical Mac application when I should avoid
  1154. > breaking into the Think Debugger?
  1155.  
  1156. I found that using Debugger() in a MacTCP ASR or callback is dangerous when
  1157. debugging an application using the Think Debugger, but I probably should have
  1158. known better.
  1159.  
  1160. John
  1161. --
  1162. John J. Chew, III                            * jjchew@AIS.Berger-Levrault.FR
  1163. AIS/Berger-Levrault * phone +33 83 35 55 56  * poslfit@UTCS.UToronto.CA
  1164. 18, rue des Glacis  * fax   +33 83 37 56 72  * poslfit@utorgpu.bitnet
  1165. F-54017 Nancy Cedex * telex BL NANCY 960 212 * Berger.Lev.@AppleLink.Apple.Com
  1166. "TCP _a_synchronous _n_otification _r_outine (_A_S_R_)"
  1167. 
  1168. 
  1169. Path: ucivax!gateway
  1170. From: jjch@uranie.ais.berger-levrault.fr (John J Chew)
  1171. Subject: VT-102 emulation
  1172. Message-ID: <9201131618.AA09313@uranie.AIS.Berger-Levrault.FR>
  1173. Newsgroups: fa.think-c
  1174. Lines: 43
  1175. Date: 13 Jan 92 17:45:07 GMT
  1176.  
  1177. In response to ... (bother... rummage, rummage... er...) someone from .is
  1178. who asked whether or not VT-102 specifications and/or a THINK C class are
  1179. available if he didn't want to use CTB:
  1180.  
  1181. I am working on a THINK C VT-220 emulator pane, and while it is by no means
  1182. complete, if you are in a fix I could send you a copy in library form that
  1183. you could alpha-test.
  1184.  
  1185. (The VT-220 command set is a superset of the VT-102 set and can be restricted
  1186. to run in strict VT-100 compliant mode, the VT-100 set being a subset of the
  1187. VT-102.)
  1188.  
  1189. By the end of today the pane should support:
  1190.  
  1191. - 80-/132-column operation (except you need 527 horizontal pixels to see
  1192.   132 columns at 6 point, or 791 at 9 point)
  1193. - ASCII, VT-100 graphic and ISO character sets
  1194. - bold, reverse video and underlined characters
  1195. - copy + paste (with both TEXT and styl generated on copy)
  1196. - most controls and escape sequences, certainly enough to use curses.
  1197. - playing of named sound resources using a special escape sequence
  1198.  
  1199. It does not yet support:
  1200.  
  1201. - blinking characters
  1202. - downloadable character sets
  1203. - extra-wide, extra-tall etc. characters
  1204. - insert/delete character/line sequences (RSN)
  1205. - keyboard input mapping (for function keys or eight-bit characters)
  1206. - national character sets
  1207. - VT-52 emulation
  1208.  
  1209. The class is a little less than 11K and is a descendant of CPane with new
  1210. methods Read() and Write() to read keyboard input and write to the terminal
  1211. emulator.
  1212.  
  1213. John
  1214. --
  1215. John J. Chew, III                            * jjchew@AIS.Berger-Levrault.FR
  1216. AIS/Berger-Levrault * phone +33 83 35 55 56  * poslfit@UTCS.UToronto.CA
  1217. 18, rue des Glacis  * fax   +33 83 37 56 72  * poslfit@utorgpu.bitnet
  1218. F-54017 Nancy Cedex * telex BL NANCY 960 212 * Berger.Lev.@AppleLink.Apple.Com
  1219. "Les arbres sont souvent en cause dans les accidents de la circulation."
  1220. 
  1221. 
  1222. Path: ucivax!gateway
  1223. From: ECO861771@ecostat.aau.dk ("Povl H. Pedersen")
  1224. Subject: Re: SFFile Structure
  1225. Message-ID: <B69EAB3273DF000A87@vms2.uni-c.dk>
  1226. Newsgroups: fa.think-c
  1227. X-Vms-To: IN::"think-c@ics.uci.edu"
  1228. Lines: 8
  1229. Date: 13 Jan 92 17:49:42 GMT
  1230. X-Envelope-To: think-c@ics.uci.edu
  1231.  
  1232.  
  1233. I see no reason why to make an 'appe'. Just make it an APPL, and
  1234. then set the background only flag. Then put it into the startup items
  1235. folder, and it will do what you want. Then suspend itself when done.
  1236. Finder will reopen it when needed for new docs.
  1237.  
  1238. Povl H. Pedersen
  1239. eco861771@ecostat.aau.dk
  1240. 
  1241. 
  1242. Path: ucivax!gateway
  1243. From: DNEBING@opie.bgsu.edu ("Mr. Neb")
  1244. Subject: Re: Bug in TC5.0.1 Compiler....
  1245. Message-ID: <01GF9TB35UPS0000KB@opie.bgsu.edu>
  1246. X-VMS-Cc: DNEBING
  1247. Newsgroups: fa.think-c
  1248. X-VMS-To: IN%"think-c@ics.uci.edu"
  1249. Lines: 5
  1250. Date: 13 Jan 92 20:29:57 GMT
  1251. X-Envelope-to: think-c@ics.uci.EDU
  1252.  
  1253.  
  1254.     What is bad about disabling the quit menu option is when your
  1255. little program gets stuck in some kind of bug-induced loop for which you
  1256. can not escape....
  1257.  
  1258. 
  1259. 
  1260. Path: ucivax!gateway
  1261. From: DNEBING@opie.bgsu.edu ("Mr. Neb")
  1262. Subject: ProcPtr parameters v2
  1263. Message-ID: <01GF9TS77V9W0000KB@opie.bgsu.edu>
  1264. X-VMS-Cc: DNEBING
  1265. Newsgroups: fa.think-c
  1266. X-VMS-To: IN%"think-c@ics.uci.edu"
  1267. Lines: 37
  1268. Date: 13 Jan 92 20:44:37 GMT
  1269. X-Envelope-to: think-c@ics.uci.EDU
  1270.  
  1271.  
  1272.     This is the type of thing that I want to implement:
  1273.  
  1274. void foo(ProcPtr BarProc){
  1275.     int a;
  1276.  
  1277.     ...
  1278.     a=BarProc();
  1279.     ...
  1280. }
  1281.  
  1282. int BarOne(void){
  1283.     ...
  1284. }
  1285.  
  1286. int BarTwo(void){
  1287.     ...
  1288. }
  1289.  
  1290. main(){
  1291.     foo(BarOne);
  1292.     foo(BarTwo);
  1293.     ...
  1294. }
  1295.  
  1296.     This is just a small example.  Taken apart, I have one function
  1297. which should accept another function as a parameter.  To pass a function
  1298. to one of the toolbox calls (i.e. a filter procedure) it must be declared
  1299. as:
  1300.     pascal short myfilter();
  1301. before it can be passed as a parameter.  What is the syntax to pass BarOne
  1302. or BarTwo to one of my own procedures.  I get wacked out error messages when
  1303. I try to do it like the example above.
  1304.  
  1305.     Any answers?
  1306.  
  1307.     dnebing@opie.bgsu.edu
  1308. 
  1309. 
  1310. Path: ucivax!gateway
  1311. From: TLEAMING@gemini.sim.es.com (Taylor Leaming 801/582-5847 x3836)
  1312. Subject: Think C Project segmentation and #pragma segment directive
  1313. Message-ID: <920113115730.20201926@GEMINI.SIM.ES.COM>
  1314. Newsgroups: fa.think-c
  1315. Lines: 31
  1316. Date: 13 Jan 92 22:19:34 GMT
  1317. X-Vmsmail-To: SMTP%"think-c-request@ics.uci.edu"
  1318.  
  1319. I have a question concerning how Think C's project file and the C preprocessor
  1320. #pragma segment directive (from MPW) can be used together to segment your
  1321. source files and function routines.
  1322.  
  1323. Want I'm after is to be able to put functions into files where they make sense
  1324. logically, grouping them by their relationships to each other.
  1325.  
  1326. Then, I want to be able to use #pragma segment directive to group them.
  1327.  
  1328. From what I've been able to find, Think C provides for only four #pragma
  1329. directives, the segment directive not being one of them.  However, the Project
  1330. file lets you organize FILES into segments.
  1331.  
  1332. So you can group you functions into files so they can be placed into separate
  1333. segments in the Think C project, or live with it.
  1334.  
  1335. What are people doing to overcome this problem?
  1336.  
  1337. I would like to be able to port in files from MPW which allows for the
  1338. #pragma segment directive, and retain the best virtues of both worlds.
  1339.  
  1340. Thanks in advance,
  1341.  
  1342. Taylor
  1343.  
  1344. --------------------------------------------------------------------------
  1345. Taylor Leaming                                  tleaming@gemini.sim.es.com
  1346. Simulation Division
  1347. Evans & Sutherland Computer Corp.
  1348. SLC, UT                                                       801/582-5847
  1349.  
  1350. 
  1351. 
  1352. Path: ucivax!gateway
  1353. From: TSEAL%ALASKA.BITNET@cornellc.cit.cornell.edu (The Spanish Inquisition)
  1354. Subject: Plenty Questions
  1355. Message-ID: <9201140934.aa18060@q2.ics.uci.edu>
  1356. Newsgroups: fa.think-c
  1357. Lines: 31
  1358. Date: 14 Jan 92 17:34:28 GMT
  1359.  
  1360. Using the Mac Primer, I have successfully cleared the screen (mimicking the
  1361. flying line demo), but I can't find the command to plot a single point on the
  1362. screen, so
  1363.  
  1364. Do pixels reside in a specific area of memory?  If so, what hexidecimal range
  1365. would it be or how could I find out?
  1366.  
  1367. What command could I use (with coordinates now, not hex) to plot a point?
  1368. Basic has its PSET, etc.
  1369.  
  1370. Are there any references/sample programs that I could access to find out more
  1371. about graphics?  Specific programs on info-mac, a book such as the Mac Primer,
  1372. any information would be greatly appreciated.
  1373.  
  1374. Thanks in advance!
  1375.  
  1376. =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  1377.  
  1378.   _______________                                      /
  1379.  ///==========///                                     /   Eric Lawson
  1380. ///          ///                                     /
  1381.             ///               _____________         /   TSEAL@ALASKA.BITNET
  1382.        ____///_________      ///==========/        /   TSEAL@ACAD1.ALASKA.EDU
  1383.       /=============///    ///                    /
  1384.          ///        ///  ///                     /   P.O. Box 240652
  1385.         ///         //////                      /   Douglas, AK 99824
  1386.        ///          ////                       /   (907) 364-2462
  1387.       ///           //                        /
  1388. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
  1389.  
  1390.  
  1391. 
  1392. 
  1393. Path: ucivax!gateway
  1394. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  1395. Subject: SetUpA4 and optimizations - solution
  1396. Message-ID: <199201150117.AA10001@tarski.cogsci.uiuc.edu>
  1397. X-Mailer: Eudora [version 1.3a11 CTB]
  1398. Newsgroups: fa.think-c
  1399. Lines: 49
  1400. Date: 15 Jan 92 01:18:37 GMT
  1401.  
  1402. As you all probably have noticed, THINK C 5.0 will do no optimizing if
  1403. there is any inline assembler in a function. This is especially sad if you
  1404. use the SetUpA4.h libraries, since they are written in inline assembler. I
  1405. have re-written SetUpA4.h to use inline function calls, which THINK C will
  1406. optimize around, though it still does generate some silly code:
  1407.  
  1408. +0004  000322  MOVEM.L    D4-D7/A2/A3,-(A7)                        | 48E7
  1409. 0F30
  1410. +0008  000326  MOVE.L     A4,-(A7)                                 | 2F0C
  1411. .
  1412. .
  1413. +00B4  0003D2  MOVEA.L    (A7)+,A4                                 | 285F
  1414. +00B6  0003D4  MOVEM.L    (A7)+,D4-D7/A2/A3                        | 4CDF
  1415. 0CF0
  1416.  
  1417. But the rest of the code generated is loads better. If anyone sees any
  1418. problems with the following, please let me know.
  1419.  
  1420. pr
  1421. --
  1422. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1423. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1424. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1425. Internet: resnick@cogsci.uiuc.edu
  1426.  
  1427. /* MySetUpA4.h -- Pete Resnick, January 1992 */
  1428.  
  1429. static void
  1430. __GetA4(void)
  1431. {
  1432.     asm {
  1433.         bsr.s    @1
  1434.         dc.l    0            ;  store A4 here
  1435. @1        move.l    (sp)+,a1
  1436.     }
  1437. }
  1438.  
  1439. static void __StoreA4(void) = {0x228C};
  1440. static void __StoreA0(void) = {0x2288};
  1441. static void __PushA4(void) = {0x2F0C};
  1442. static void __RetrieveA4(void) = {0x2851};
  1443. static void __PopA4(void) = {0x285F};
  1444.  
  1445. #define RememberA4()    do { __GetA4(); __StoreA4(); } while (0)
  1446. #define RememberA0()    do { __GetA4(); __StoreA0(); } while (0)
  1447.  
  1448. #define SetUpA4()        do { __PushA4(); __GetA4(); __RetrieveA4(); } while (0)
  1449. #define RestoreA4()        do { __PopA4(); } while (0)
  1450.  
  1451. 
  1452. 
  1453. Path: ucivax!gateway
  1454. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  1455. Subject: SetUpA4 and optimizations - solution
  1456. Message-ID: <199201150520.AA10218@tarski.cogsci.uiuc.edu>
  1457. X-Mailer: Eudora [version 1.3a11 CTB]
  1458. Newsgroups: fa.think-c
  1459. Lines: 55
  1460. Date: 15 Jan 92 05:21:10 GMT
  1461.  
  1462. Sorry for the re-post. Evidently the last one got cut off.
  1463.  
  1464. As you all probably have noticed, THINK C 5.0 will do no optimizing if
  1465. there is any inline assembler in a function. This is especially sad if you
  1466. use the SetUpA4.h libraries, since they are written in inline assembler. I
  1467. have re-written SetUpA4.h to use inline function calls, which THINK C will
  1468. optimize around, though it still does generate some silly code:
  1469.  
  1470. +0004  000322  MOVEM.L    D4-D7/A2/A3,-(A7)                        | 48E7
  1471. 0F30
  1472. +0008  000326  MOVE.L     A4,-(A7)                                 | 2F0C
  1473. ...
  1474. +00B4  0003D2  MOVEA.L    (A7)+,A4                                 | 285F
  1475. +00B6  0003D4  MOVEM.L    (A7)+,D4-D7/A2/A3                        | 4CDF
  1476. 0CF0
  1477.  
  1478. But the rest of the code generated is loads better. If anyone sees any
  1479. problems with the following, please let me know.
  1480.  
  1481. pr
  1482. --
  1483. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1484. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1485. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1486. Internet: resnick@cogsci.uiuc.edu
  1487.  
  1488. /* MySetUpA4.h -- Pete Resnick, January 1992 */
  1489.  
  1490. static void
  1491. __GetA4(void)
  1492. {
  1493.     asm {
  1494.         bsr.s    @1
  1495.         dc.l    0            ;  store A4 here
  1496. @1        move.l    (sp)+,a1
  1497.     }
  1498. }
  1499.  
  1500. static void __StoreA4(void) = {0x228C};
  1501. static void __StoreA0(void) = {0x2288};
  1502. static void __PushA4(void) = {0x2F0C};
  1503. static void __RetrieveA4(void) = {0x2851};
  1504. static void __PopA4(void) = {0x285F};
  1505.  
  1506. #define RememberA4()    do { __GetA4(); __StoreA4(); } while (0)
  1507. #define RememberA0()    do { __GetA4(); __StoreA0(); } while (0)
  1508.  
  1509. #define SetUpA4()        do { __PushA4(); __GetA4(); __RetrieveA4(); } while (0)
  1510. #define RestoreA4()        do { __PopA4(); } while (0)
  1511. --
  1512. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1513. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1514. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1515. Internet: resnick@cogsci.uiuc.edu
  1516.  
  1517. 
  1518. 
  1519. Path: ucivax!gateway
  1520. From: es2q+@andrew.cmu.edu (Erik Warren Selberg)
  1521. Subject: Custom Dialog and TCL
  1522. Message-ID: <kdQwOcC00WB84qokhV@andrew.cmu.edu>
  1523. Newsgroups: fa.think-c
  1524. Lines: 24
  1525. Date: 15 Jan 92 05:31:43 GMT
  1526.  
  1527. (I sent this out a bit ago, but haven't had much luck with the
  1528. responses.  Anyway, here goes again:)
  1529.  
  1530. I'm trying to create a custom dialog / window which does the
  1531. following:
  1532.  
  1533. Has three lists
  1534.   (1) a list of PICTs
  1535.   (2) a standard list of function names
  1536.   (3) a list of timings (timing = a name + a bunch of squares)
  1537.  
  1538. What I want to do is:
  1539.   Select some PICTs, some functions, and some of the squares in the
  1540. timing (preferably, the name would not be highlightable), then signal
  1541. the program that the user has done this.  How would I go about doing
  1542. this using the TCL?
  1543.  
  1544. Thanks,
  1545. Erik
  1546.  
  1547.  
  1548.                           -/-   flup! flup! flup!   -\-
  1549. ARPA: es2q@andrew.cmu.edu -\- It's not just a name. -/- Fido: 129/107
  1550. Don't sue, I'm broke      -/-     It's a dance.     -\- BBS:  (412) 683-1235
  1551. 
  1552. 
  1553. Path: ucivax!gateway
  1554. From: liberte@ncsa.uiuc.edu (Daniel LaLiberte)
  1555. Subject: Templa Graphica
  1556. Message-ID: <9201151539.AA04955@void.ncsa.uiuc.edu>
  1557. Newsgroups: fa.think-c
  1558. Lines: 21
  1559. Date: 15 Jan 92 15:40:16 GMT
  1560.  
  1561. I just picked up the "Templa Graphica" book and disks from the bookstore.
  1562. It is a very interesting "Generic Graphical Editor" for the mac, similar
  1563. to Diagram! for the NeXT, but perhaps more powerful - I'm not sure yet.
  1564. What you do is define a notation template file for your domain of interest
  1565. with the Templa program, and then use it with the Graphica program.
  1566.  
  1567. Anyway, the source code is included and it is in THINK C.  Good thing too
  1568. since it was not possible to open a new document for a new template.
  1569. Otherwise it appeared to run fine under system 7 on a IIfx.  So I went
  1570. about recompiling the source using THINK C 5.0 and fixed a bunch of
  1571. missing cast problems (I couldn't get THINK C to ignore them).  The
  1572. actual bug was easy to fix.  I'm willing to share my fixes with anyone
  1573. who wants them.  But I'd also like to get ahold of the author, Dr Sharam
  1574. Hekmatpour of Advanced Imaging Systems Kodak (Australasia) Pty Ltd.
  1575.  
  1576.  
  1577. Dan LaLiberte
  1578. National Center for Supercomputing Applications
  1579.  
  1580. liberte@ncsa.uiuc.edu
  1581. (Join the League for Programming Freedom: league@prep.ai.mit.edu)
  1582. 
  1583. 
  1584. Path: ucivax!gateway
  1585. From: sink@zorro.cecer.army.mil ("Eric W. Sink")
  1586. Subject: Re: Custom Dialog and TCL
  1587. Message-ID: <9201151541.AA24170@zorro.cecer.army.mil>
  1588. In-Reply-To: <kdQwOcC00WB84qokhV@andrew.cmu.edu>; from "Erik Warren Selberg" at Jan 15, 92 5:31 am
  1589. X-Mailer: ELM [version 2.3 PL11]
  1590. Newsgroups: fa.think-c
  1591. Lines: 100
  1592. Date: 15 Jan 92 15:43:03 GMT
  1593.  
  1594. > I'm trying to create a custom dialog / window which does the
  1595. > following:
  1596. >
  1597. > Has three lists
  1598. >   (1) a list of PICTs
  1599. >   (2) a standard list of function names
  1600. >   (3) a list of timings (timing = a name + a bunch of squares)
  1601. >
  1602. > What I want to do is:
  1603. >   Select some PICTs, some functions, and some of the squares in the
  1604. > timing (preferably, the name would not be highlightable), then signal
  1605. > the program that the user has done this.  How would I go about doing
  1606. > this using the TCL?
  1607.  
  1608. Making dialogs is not the easiest thing in TCL.  Using the CDialog classes
  1609. seems the best way to go, but it is not well documented.  Here is the
  1610. way I am doing a dialog :
  1611.  
  1612. 1.  I design the dialog as usual in ResEdit.  Assign command numbers to
  1613.     the buttons (Ok#100,Cancel#101).  Look at the comments at the end
  1614.     of CDLOGDialog.c for info on how to create special panes and stuff
  1615.     like that.  Keep in mind as you design the dialog that the result
  1616.     will be a collection of objects, not a normal Mac dialog.  The CDialog
  1617.     classes handle dialogs as plain windows with controls in them.  They
  1618.     do not use the Dialog Manager.
  1619.  
  1620. 2.  Now, when you start up the dialog, TCL scans the DITL resource
  1621.     created by ResEdit, and creates a CDLOGDialog object corresponding to the
  1622.     Dialog you designed.  The problem is that you need access to the
  1623.     individual objects in dialog.  Basically you have to search the dialog
  1624.     using the item numbers as keys.  For example, suppose that item 5
  1625.     is a check box button :
  1626.  
  1627.   aCheckBox = (CCheckBox *) myDialogDirector->itsWindow->FindViewByID(5);
  1628.  
  1629.     Now, aCheckBox is a pointer to a CCheckBox object which you can
  1630.     manipulate as you please.  For example, you can set its current
  1631.     state according the some flag.  You can SetClickCmd on it, and
  1632.     then add code to a DoCommand method to handle it.  You can check
  1633.     its status after the dialog is closed.
  1634.  
  1635.     In general, this is how I get access to the individual items in
  1636.     a TCL dialog.
  1637.  
  1638. Now, all of the above does very little to answer your question since your
  1639. need is a special case.  There is no TCL class to represent a List Manager
  1640. list.  Now, I think I saw one in MacTutor once...  However, the CTable
  1641. class does a fine job of imitating a list, and is more versatile.  See
  1642. the NewClassDemo application for an example.
  1643.  
  1644. You have three options, as I see the situation :
  1645.  
  1646. 1.  Code the lists using the List Manager like you would if this
  1647.     were standard C.  I don't know how you would do this exactly, but
  1648.     it certainly can be done.  I don't recommend it either.
  1649.  
  1650. 2.  Find the MacTutor back issue and use that list class.
  1651.  
  1652. 3.  Use the CTable class to simulate a list.
  1653.  
  1654. With either of options 2 or 3, one problem is that you will not be
  1655. able to place the list in the dialog using ResEdit.  To my knowledge,
  1656. CDLOGDialog does not know how to create CTable objects from a resource
  1657. specification.  You will therefore have to add the object to the
  1658. dialog by hand.  This basically involves creating the CTable object
  1659. and initializing it with correct coordinates and with the CDLOGDialog
  1660. as its parent, and with the CDLOGDirector as its supervisor (someone
  1661. correct me if this is wrong).
  1662.  
  1663. To "signal the program that the user has done this" you will want to use
  1664. the facilities provided by the CTable object, probably adding some
  1665. command number which you will have to handle in a DoCommand somewhere.
  1666. I can't provide details since I don't have the manuals here.
  1667.  
  1668. The dialog you want is a complex one.  You will no doubt find yourself
  1669. frustrated with TCL, saying something like, "I thought this thing
  1670. was supposed to make it *easier*".  A word of unsolicited advice :
  1671.  
  1672. All OO frameworks carry a steep learning curve.  It's hard to learn
  1673. to do anything with the framework right away.  Unlike Smalltalk,
  1674. all frameworks based on a derivative of C offer you a way out.
  1675. If you get real frustrated, you will be tempted to just code your
  1676. application without making use of the existing classes and OO facilities.
  1677. Try to resist this temptation.  The classes are there for your benefit,
  1678. and it will be well worth your effort in the long run to learn them.
  1679.  
  1680. It is unfortunate that latest classes in the TCL are poorly documented.
  1681. No doubt, proper documentation is forthcoming, but until then, our
  1682. predicament is very much that of a beginning Smalltalk programmer.  The
  1683. only real hope is find someone who knows what is going on.
  1684.  
  1685. I'm no TCL expert, so I hope that someone more experienced will correct
  1686. my mistakes and fill in the gaps.
  1687.  
  1688. Hope this helps,
  1689.  
  1690. --
  1691. Eric W. Sink,  Spatial Analysis and Systems Team
  1692. USACERL, P.O. Box 9005, Champaign, IL 61826-9005
  1693. 1-800-USA-CERL x449,   e-sink@uiuc.edu
  1694. 
  1695. 
  1696. Path: ucivax!gateway
  1697. From: yarri@ee.eng.ohio-state.edu (Douglas Yarrington)
  1698. Subject: icons & ListManager
  1699. Message-ID: <9201151807.AA12950@maumee.eng.ohio-state.edu>
  1700. X-Mailer: ELM [version 2.3 PL0]
  1701. Newsgroups: fa.think-c
  1702. Lines: 15
  1703. Date: 15 Jan 92 18:08:25 GMT
  1704.  
  1705. People,
  1706.  
  1707. Could someone give me some advice on the best way to implement a list
  1708. using the standard ListManager that will incorporate icons similar to
  1709. the standard file lists.
  1710.  
  1711. As a sub-issue, why hasn't the standard List Manager been updated to
  1712. accomodate such lists directly?
  1713.  
  1714. Thanks.
  1715.  
  1716. --douglas
  1717.  
  1718. _______________________________________________________________________________
  1719.  Douglas Yarrington                                 yarri@ee.eng.ohio-state.edu
  1720. 
  1721. 
  1722. Path: ucivax!gateway
  1723. From: liberte@ncsa.uiuc.edu (Daniel LaLiberte)
  1724. Subject: re: Templa Graphica info
  1725. Message-ID: <9201151907.AA06151@void.ncsa.uiuc.edu>
  1726. Newsgroups: fa.think-c
  1727. Lines: 8
  1728. Date: 15 Jan 92 19:09:12 GMT
  1729.  
  1730. A little more info on Templa Graphica.
  1731.  
  1732. "Templa Graphica: A Generic Graphical Editor for the Macintosh"
  1733. by Dr Sharam Hekmatpour, 1990 by Prentice Hall of Australia Pty Ltd
  1734. ISBN: 0-13-904160-5
  1735. $59.00 including two disks with software and THINK C source.
  1736.  
  1737. dan
  1738. 
  1739. 
  1740. Path: ucivax!gateway
  1741. From: blake@seagull.math.byu.edu (Blake Fordham)
  1742. Subject: scroll panes
  1743. Message-ID: <9201161630.AA17975@seagull.math.byu.edu>
  1744. Newsgroups: fa.think-c
  1745. Lines: 13
  1746. Date: 16 Jan 92 16:32:47 GMT
  1747.  
  1748. I just started using TCL and I've run into a small idiosyncrasy that I
  1749. can't track down.  I have a scroll pane with a CBitMapPane inside it.  When
  1750. I scroll all the way to the right (or bottom), 2 problems show up:
  1751.   First, the BitMapPane stops scrolling when it fit the window frame insted
  1752. of the interior of the scroll pane,  so the 16 pixels on the edge don't show.
  1753.   Second, if I then enlarge the window, the BitMapPane doesn't "stick" to
  1754. the right and bottom edges so I get white rectangular regions on the edges
  1755. of the bit map's picture.
  1756.  
  1757. Has anyone had this happen to them?  What class methods do I need to adjust or
  1758. rewrite?
  1759.  
  1760. Blake
  1761. 
  1762. 
  1763. Path: ucivax!gateway
  1764. From: kkirksey@eng.auburn.edu ("Kenneth B. Kirksey")
  1765. Subject: Bison & Flex
  1766. Full-Name: Kenneth B. Kirksey
  1767. Message-ID: <9201161801.AA14269@eng.auburn.edu>
  1768. Newsgroups: fa.think-c
  1769. Lines: 7
  1770. Date: 16 Jan 92 18:01:32 GMT
  1771.  
  1772.  
  1773. I was wondering if anyone has fixed the Think C versions of bison and flex
  1774. that are in the archives so that they will compile without modification
  1775. under Think C 5.0.  I just wanted to see if someone else had already done
  1776. the work before I tried it.
  1777.  
  1778.                                   Ken
  1779. 
  1780. 
  1781. Path: ucivax!gateway
  1782. From: Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer)
  1783. Subject: SPLAsh
  1784. Message-ID: <m0l4dAj-00024wC@rsoft.bc.ca>
  1785. Newsgroups: fa.think-c
  1786. Lines: 8
  1787. Date: 16 Jan 92 20:38:22 GMT
  1788.  
  1789. Are any of you a member of SPLAsh (The Symantec Programming Languages
  1790. Association)?  Is it worth it?  Recommendations, warnings?
  1791. --
  1792. -------------------------------------------------------------------
  1793.  Daryl Spitzer                    "Life isn't just, life just is."
  1794.  Vancouver, Canada                         -- Me  (I think.)
  1795.  Daryl_Spitzer@mindlink.bc.ca
  1796. -------------------------------------------------------------------
  1797. 
  1798. 
  1799. Path: ucivax!gateway
  1800. From: kovar@eclectic.com
  1801. Subject: SPLAsh
  1802. Message-ID: <199201170154.AA18179@eclectic.com>
  1803. Newsgroups: fa.think-c
  1804. Lines: 11
  1805. Date: 17 Jan 92 02:04:19 GMT
  1806.  
  1807.  
  1808. >Are any of you a member of SPLAsh (The Symantec Programming Languages
  1809. >Association)?  Is it worth it?  Recommendations, warnings?
  1810.  
  1811.   I joined at least a year ago, maybe two. I can only find two mailings
  1812. from them of any substance in my records. Unless they plan on getting
  1813. their act together, I'd say that they're not worth it.
  1814.  
  1815. -David
  1816.  
  1817.  
  1818. 
  1819. 
  1820. Path: ucivax!gateway
  1821. From: halam1@ub.d.umn.edu ("Haseen I. Alam")
  1822. Subject: ColorToolBox.h
  1823. Message-ID: <9201170420.AA29186@ub.d.umn.edu>
  1824. X-Mailer: ELM [version 2.3 PL11]
  1825. Newsgroups: fa.think-c
  1826. Lines: 36
  1827. Date: 17 Jan 92 04:19:20 GMT
  1828.  
  1829.  
  1830.  Hi there,
  1831.  
  1832.      I just ftp-d the source code for the Simple Raster Graphics Package
  1833.      (SRGP) and was trying to compile it under ThinkC 5.0.2.  First they
  1834.      asked to pre-compile a HEADERS file, but the compiler complains about
  1835.      the #include <ColorToolbox.h> statement, saying that it can't open the
  1836.      ColorToolbox.h file.
  1837.  
  1838.      Has anyone compiled this under ThinkC 5.0 with success?  This source
  1839.      accompanies the book "Computer Graphics: Principles and Practice," by
  1840.      Foley, vanDam, Feiner, and Hughes.  Am I missing some files from this
  1841.      distribution?
  1842.  
  1843.      Another error is that DrawText and SRGP__error are said to have "invalid
  1844.      redclarations."  I tried to find the other definitions with the search
  1845.      but could not find another declaration.
  1846.  
  1847.      ThinkC says that prototype is required for plot_with_line_style.  Can't
  1848.      find its definition anywhere.
  1849.  
  1850.      Now here is the most interesting one.  How do I read this if statement,
  1851.      given the following declarations?  Again it asks for the prototype for
  1852.      the last call.
  1853.  
  1854.      DECLARE funcptr         srgp__resizeCallback;
  1855.      int www, hhh
  1856.      if (srgp__resizeCallback)
  1857.         (*srgp__resizeCallback) (www, hhh);
  1858.  
  1859.      Thanks in advance.
  1860.  Haseen.
  1861.  .-------------------------------------------------------------------------.
  1862.  | "If you think I am expensive, wait  | email: halam1@ub.d.umn.edu        |
  1863.  |     till you hire an amateur!"      |    or  st0404@AppleLink.Apple.Com |
  1864.  `-------------------------------------------------------------------------'
  1865. 
  1866. 
  1867. Path: ucivax!gateway
  1868. From: ephraim@think.com (Ephraim Vishniac)
  1869. Subject: Re: ColorToolBox.h
  1870. Message-ID: <9201171314.AA10837@leander.think.com>
  1871. In-Reply-To: Your message of "17 Jan 92 04:19:20 GMT."
  1872.              <9201170420.AA29186@ub.d.umn.edu>
  1873. Newsgroups: fa.think-c
  1874. Lines: 38
  1875. Date: 17 Jan 92 13:15:00 GMT
  1876.  
  1877.  
  1878.    From: "Haseen I. Alam" <halam1@ub.d.umn.edu>
  1879.    Date: 17 Jan 92 04:19:20 GMT
  1880.  
  1881.      I just ftp-d the source code for the Simple Raster Graphics Package...
  1882.  
  1883.      Another error is that DrawText and SRGP__error are said to have "invalid
  1884.      redclarations."  I tried to find the other definitions with the search
  1885.      but could not find another declaration.
  1886.  
  1887. Two possibilities: There is a prototype somewhere, and it conflicts
  1888. with the actual definition, or (if you have "infer prototypes" turned
  1889. on) the usage of the function conflicts with its definition.
  1890.  
  1891.      ThinkC says that prototype is required for plot_with_line_style.  Can't
  1892.      find its definition anywhere.
  1893.  
  1894.      Now here is the most interesting one.  How do I read this if statement,
  1895.      given the following declarations?  Again it asks for the prototype for
  1896.      the last call.
  1897.  
  1898.      DECLARE funcptr         srgp__resizeCallback;
  1899.      int www, hhh
  1900.      if (srgp__resizeCallback)
  1901.         (*srgp__resizeCallback) (www, hhh);
  1902.  
  1903. Think of it this way:
  1904.  
  1905.    if (srgp_resizeCallback != NULL) {
  1906.     (*srgp_resizeCallback)(www, hhh);
  1907.    }
  1908.  
  1909. You need a prototype because funcptr is (I imagine) an unprototyped
  1910. pointer to function returning int. But srgp_resizeCallback has
  1911. parameters and no return value, so its type is really "void
  1912. (*srgp_resizeCallback)(int www, int hhh);". My syntax may be somewhat
  1913. off. I always have trouble with prototyping function pointers.
  1914.  
  1915. 
  1916. 
  1917. Path: ucivax!gateway
  1918. From: nagel@ics.uci.edu (Mark Nagel)
  1919. Subject: ARCHIVE: THINK C 5.0.2 + TCL 1.2.2 updaters
  1920. Message-ID: <15092.695668023@ics.uci.edu>
  1921. Newsgroups: fa.think-c
  1922. Reply-To: dmac@mit.edu
  1923. Lines: 28
  1924. Date: 17 Jan 92 17:07:11 GMT
  1925.  
  1926. Date: Fri, 17 Jan 92 08:08:49 EDT
  1927. From: "David S. McCormick" <dmac@mit.EDU>
  1928. Subject: Upload of combined Think C and TCL update
  1929.  
  1930. Mark:
  1931.  
  1932. I just transferred a combination of the Think C 5.0.2 and
  1933. TCL 1.1.2 in a binhex'ed self-extracting archive to
  1934. /incoming
  1935.  
  1936. This is a combination of new Debugger, Think C app patcher
  1937. v5.0.{0,1} => v5.0.2, and the v1.1.2 upgrade of the Think Class Library
  1938. in C.
  1939.  
  1940. Other people can send it to sumex and/or umich if they want.
  1941. As previously indicated, the other file I uploaded is just the
  1942. Think C upgrade.
  1943.  
  1944. Cheers,
  1945. David S. McCormick
  1946. dmac@athena.mit.edu
  1947.  
  1948. Bldg. 54-1016
  1949. MIT-EAPS Geology
  1950. Cambridge, MA  02139
  1951. 617-253-5747
  1952.  
  1953. [saved as: /mac/think-c/symantec/502+112-updaters.hqx; 608K]
  1954. 
  1955. 
  1956. Path: ucivax!gateway
  1957. From: yarri@ee.eng.ohio-state.edu (Douglas Yarrington)
  1958. Subject: Re: Bison & Flex
  1959. Message-ID: <9201172100.AA27694@rainier.eng.ohio-state.edu.eng.ohio-state.edu>
  1960. In-Reply-To: <9201161801.AA14269@eng.auburn.edu>; from "Kenneth B. Kirksey" at Jan 16, 92 6:01 pm
  1961. X-Mailer: ELM [version 2.3 PL0]
  1962. Newsgroups: fa.think-c
  1963. Lines: 27
  1964. Date: 17 Jan 92 21:04:58 GMT
  1965.  
  1966. Ken,
  1967.  
  1968. > I was wondering if anyone has fixed the Think C versions of bison and flex
  1969. > that are in the archives so that they will compile without modification
  1970. > under Think C 5.0.  I just wanted to see if someone else had already done
  1971. > the work before I tried it.
  1972.  
  1973. I edited the Bison file bison.simple to get the *.tab.c files to work
  1974. with Think C 5.0.
  1975.  
  1976. Add the following includes to the begining of bison.simple:
  1977. #include <stdlib.h>
  1978. #include <string.h>
  1979.  
  1980. Also in bison.simple, search for bcopy and replace with memmove (3
  1981. occurances), search for alloca and replace with malloc (3 occurances.)
  1982.  
  1983. I just did this yesterday, and I got it to compile, but I'm not sure
  1984. if I've handled the memory correctly. I believe alloca allocates
  1985. memory diffrently than malloc, but I didn't check it.
  1986.  
  1987. Hope this helps. And if I've done something wrong, please let me know.
  1988.  
  1989. --douglas
  1990.  
  1991. _______________________________________________________________________________
  1992.  Douglas Yarrington                                 yarri@ee.eng.ohio-state.edu
  1993. 
  1994. 
  1995. Path: ucivax!gateway
  1996. From: nick@dcs.edinburgh.ac.uk (Nick Rothwell)
  1997. Subject: Re: Plenty Questions
  1998. Message-ID: <9201171303.aa17391@dcs.ed.ac.uk>
  1999. Newsgroups: fa.think-c
  2000. Lines: 29
  2001. Date: 17 Jan 92 22:04:59 GMT
  2002.  
  2003. [Attempt #3]
  2004.  
  2005. [Attempt #2]
  2006.  
  2007. >Using the Mac Primer, I have successfully cleared the screen (mimicking the
  2008. >flying line demo),
  2009.  
  2010. Congratulations, it sounds like you've successfully written a totally
  2011. non-portable, user-hostile, nonstandard Macintosh program.
  2012.  
  2013. >Do pixels reside in a specific area of memory?  If so, what hexidecimal range
  2014. >would it be or how could I find out?
  2015.  
  2016. Let's just say this is a meaningless question, what with multiple monitors
  2017. and bit depths, System Extensions which redefine the drawing environment,
  2018. add-on graphics accelerating hardware, and a little-known feature of the
  2019. Macintosh called the Window Manager.
  2020.  
  2021. >Are there any references/sample programs that I could access to find out more
  2022. >about graphics?  Specific programs on info-mac, a book such as the Mac Primer,
  2023. >any information would be greatly appreciated.
  2024.  
  2025. Flames aside - you're going about this the wrong way. Treat yourself to
  2026. some of the Inside Macintosh books (I and II for starters, V if you're
  2027. interested in colour). And try to forget this setting-a-pixel-in-memory
  2028. stuff - It was just a bad dream you had.
  2029.  
  2030.         Nick.
  2031.  
  2032. 
  2033. 
  2034. Path: ucivax!gateway
  2035. From: nick@dcs.edinburgh.ac.uk (Nick Rothwell)
  2036. Subject: Re: Bug in TC5.0.1 Compiler....
  2037. Message-ID: <9201171302.aa17290@dcs.ed.ac.uk>
  2038. Newsgroups: fa.think-c
  2039. Lines: 16
  2040. Date: 17 Jan 92 22:05:33 GMT
  2041.  
  2042. [Attempt #4]
  2043.  
  2044. [Attempt #3]
  2045.  
  2046. [Attempt #2 - mail problems at this end]
  2047.  
  2048. >    What is bad about disabling the quit menu option is when your
  2049. >little program gets stuck in some kind of bug-induced loop for which you
  2050. >can not escape....
  2051.  
  2052. I assume this is a follow-up to my comments about TC5.0.1 allowing itself
  2053. to be quitted from the Finder even when running projects, but I'm afraid I
  2054. don't understand what you're trying to say.
  2055.  
  2056.         Nick.
  2057.  
  2058. 
  2059. 
  2060. Path: ucivax!gateway
  2061. From: FLEMINGM@qucdn.queensu.ca ("R. Mark Fleming")
  2062. Subject: re: sicn list manager LDEF
  2063. Message-ID: <9201171456.aa13169@q2.ics.uci.edu>
  2064. Newsgroups: fa.think-c
  2065. Lines: 192
  2066. Date: 17 Jan 92 22:56:17 GMT
  2067.  
  2068. Here's an example of LDEF for SICN with Text.   I just updated it to
  2069. also work with the current Hilite Color.   I have not used it or test
  2070. the change, I have had it for sometime just incase I need it.
  2071.  
  2072. /*
  2073.     sicn ldef.c  v1.0
  2074.     Copyright 1989 Josh Pritikin
  2075.     All rights reserved.
  2076.  
  2077.     This LDEF may be used freely in any programming project, no string attached.
  2078.  
  2079.     This LDEF will let you display text as with a normal LDEF except you can
  2080.     also attach SICN's to each item.  I wrote this to emulate the one in SFDialog.
  2081.  
  2082.     The data format is as follows:
  2083.  
  2084.     char    index into the SICN resource
  2085.     Pstr    the item's text
  2086.  
  2087.     The SICN used is the one that has the same ID as the LDEF.  The SICN id
  2088.     could be uptained in a more versital way but I didn't want to spend too
  2089.     much time on this mini-project.
  2090.  
  2091.     If you add color capabilities or figure out a better way to specify the
  2092.     SICN id, send me a copy of your source.
  2093.  
  2094. Add change for color see line marked with RMF
  2095.  
  2096.     Change History
  2097.  
  2098. 12.19.89    Created and tested.
  2099. 12.19.89    v1.0 Release
  2100. 12.19.89    Now the high bit of the sicn index indicates whether to hilite the
  2101.             item or not.  Set means disabled.
  2102. 12.22.89    If the item is disabled you can't select it anymore. Your appl will
  2103.             have to check because the List Mgr thinks the item is selected but
  2104.             it wont show on screen.
  2105. 12.19.89    v1.02 Release - (sorry 'bout not making this the first release)
  2106.  
  2107.     I can be reached at different speed at:
  2108.  
  2109. fast->            (every day)
  2110.     internet: 6500stom@ucsbuxa.ucsb.edu
  2111.     AppleLink: 6500stom%ucsbuxa@hub.ucsb.edu@DASNET#
  2112.     CIS: >INTERNET:6500stom%ucsbuxa@hub.ucsb.edu
  2113. slow->            (once a week)
  2114.     GEnie: J.Pritikin
  2115.     AppleLink: Josh.P
  2116. very slow->        (once a month, if yer lucky)
  2117.     CIS: 70771,2131
  2118. */
  2119.  
  2120. typedef unsigned char    uchar;
  2121.  
  2122. /* #define testing */
  2123.  
  2124. #ifdef testing
  2125. pascal void ldef128(int message, Boolean select, Rect *bounds, Cell cell,
  2126.     int DataOff, int DataLen, ListHandle lhandle)
  2127. #else
  2128. pascal void main(int message, Boolean select, Rect *bounds, Cell cell,
  2129.     int DataOff, int DataLen, ListHandle lhandle)
  2130. #endif
  2131. {
  2132.     Rect    savedOrig;
  2133.     GrafPtr    aPort, saveport;
  2134.     int        savedFont, savedSize, savedMode, savedPenVis;
  2135.     Style    savedFace;
  2136.     PenState    ps;
  2137.     char *p;   /* Pointer used to clear Color QD flag RMF */
  2138.  
  2139.     if (message == lDrawMsg || message == lHiliteMsg) {
  2140.         GetPort(&saveport);
  2141.         aPort = (**lhandle).port;
  2142.         SetPort(aPort);
  2143.  
  2144.         savedOrig = aPort->portRect;
  2145.         SetOrigin(0,0);
  2146.         savedPenVis = aPort->pnVis;
  2147.         aPort->pnVis = 0;
  2148.         GetPenState(&ps);
  2149.  
  2150.         savedFont = aPort->txFont;
  2151.         savedSize = aPort->txSize;
  2152.         savedFace = aPort->txFace;
  2153.         savedMode = aPort->txMode;
  2154.         TextFont(systemFont);
  2155.         TextSize(0);
  2156.         TextFace(0);
  2157.         TextMode(srcOr);
  2158.     }
  2159.  
  2160.     switch (message) {
  2161.     case lInitMsg:
  2162.         {
  2163.         int        id;
  2164.         long    type;
  2165.         Str255    name;
  2166.  
  2167.         GetResInfo((**lhandle).listDefProc, &id, &type, &name);
  2168.         (**lhandle).userHandle = GetResource('SICN', id);
  2169.         HPurge((**lhandle).userHandle);
  2170.  
  2171.         break;
  2172.         }
  2173.  
  2174.     case lDrawMsg:
  2175.         {
  2176.         Handle    sicns;
  2177.         uchar    index;
  2178.         Boolean    hilited;
  2179.  
  2180.         EraseRect(bounds);
  2181.         MoveTo(bounds->left + 22, bounds->bottom - 4);
  2182.         DrawText(*(**lhandle).cells, DataOff+1, DataLen-1);
  2183.  
  2184.         index = *(*(Handle)(**lhandle).cells + DataOff);
  2185.         if (index >= 0x80) {
  2186.             index = index & 0x7f;
  2187.             hilited = false;
  2188.         } else
  2189.             hilited = true;
  2190.  
  2191.         if (btwn(index, 0, 5)) {
  2192.             sicns = (**lhandle).userHandle;
  2193.             if (sicns) {
  2194.                 LoadResource(sicns);
  2195.                 if (*sicns) {
  2196.                     BitMap    bmap;
  2197.                     Rect    r;
  2198.  
  2199.                     HNoPurge(sicns);
  2200.                     HLock(sicns);
  2201.  
  2202.                     bmap.baseAddr = *sicns+(index * 32);
  2203.                     SetRect(&bmap.bounds, 0, 0, 16, 16);
  2204.                     bmap.rowBytes = 2;
  2205.  
  2206.                     r = bmap.bounds;
  2207.                     OffsetRect(&r, bounds->left+3, bounds->top);
  2208.  
  2209.                     CopyBits(&bmap, &aPort->portBits, &bmap.bounds, &r, srcOr,
  2210.                         nil);
  2211.  
  2212.                     HUnlock(sicns);
  2213.                     HPurge(sicns);
  2214.                 }
  2215.             }
  2216.         }
  2217.  
  2218.         if (!hilited) {
  2219.             long    gray[2];
  2220.  
  2221.             PenMode(patBic);
  2222.             gray[0] = gray[1] = 0xaa55aa55;        /* 50% gray */
  2223.             PenPat(gray);
  2224.             PaintRect(bounds);
  2225.         }
  2226.  
  2227.         if (!select)
  2228.             break;
  2229.         }
  2230.  
  2231.     case lHiliteMsg:
  2232.         {
  2233.           p = (char *) 0x938;   /* Flag Invert Color */
  2234.           *p = *p & 0x7f;  /* HiLiteMode for Color QD - RMF  */
  2235.         if (*(*(Handle)(**lhandle).cells + DataOff) < 0x80)
  2236.             InvertRect(bounds);
  2237.         break;
  2238.         }
  2239.  
  2240.     case lCloseMsg:
  2241.         {
  2242.         if ((**lhandle).userHandle)
  2243.             ReleaseResource((**lhandle).userHandle);
  2244.         break;
  2245.         }
  2246.     }
  2247.  
  2248.     if (message == lDrawMsg || message == lHiliteMsg) {
  2249.         SetPenState(&ps);
  2250.         aPort->pnVis = savedPenVis;
  2251.         aPort->portRect = savedOrig;
  2252.         TextFont(savedFont);
  2253.         TextSize(savedSize);
  2254.         TextFace(savedFace);
  2255.         TextMode(savedMode);
  2256.  
  2257.         SetPort(saveport);
  2258.     }
  2259. }
  2260. 
  2261. 
  2262. Path: ucivax!gateway
  2263. From: wadew@ducvax.auburn.edu (Wade Williams)
  2264. Subject: HyperCard XFCN
  2265. Message-ID: <9201172259.AA02240@accs.duc.auburn.edu>
  2266. Newsgroups: fa.think-c
  2267. Lines: 59
  2268. Date: 17 Jan 92 23:38:14 GMT
  2269. X-Envelope-to: think-c@ics.uci.edu
  2270.  
  2271. Ok, here's one:
  2272.  
  2273. The following code works if I take out the else statement.  That is, it
  2274. returns the correct volume name if the error checking provided by the else
  2275. clause is removed.  If I leave the error checking code in and generate an
  2276. error (by not inserting a disk) it works correctly by reporting no such
  2277. volume.
  2278.  
  2279. However, if leave the error checking code in and put a disk in, instead of
  2280. returning its name, it returns the "A" with the degree symbol over it.
  2281. (Shift-option-A or 0x81 if you want to see what it is).
  2282.  
  2283. Anybody have any guess why this would return the correct volume name when
  2284. the else clause is left out and gibberish when it is included?
  2285.  
  2286. /**************************** Main ********************************/
  2287.  
  2288. pascal void main( paramPtr )
  2289. XCmdPtr    paramPtr;
  2290. {
  2291.       StringPtr        volName, theError;
  2292.       short            drvNum;
  2293.       short            vRefNum;
  2294.       long            freeBytes;
  2295.       OSErr            iErr;
  2296.  
  2297.       drvNum=1; /* 1 indicates first internal floppy */
  2298.       iErr = GetVInfo ( drvNum, volName, &vRefNum, &freeBytes );
  2299.       if (!iErr)
  2300.       {
  2301.             paramPtr->returnValue=PasToZero(paramPtr, volName );
  2302.       }
  2303.       else
  2304.       {
  2305.             switch (iErr)
  2306.             {
  2307.                case -35:  /*  no such volume */
  2308.                      theError=(StringPtr)"\pError:  No such volume.";
  2309.                      paramPtr->returnValue=PasToZero(paramPtr, theError );
  2310.                      break;
  2311.                 case -50:  /*  bad drive number */
  2312.                      theError=(StringPtr)"\pError:  Bad drive number.";
  2313.                      paramPtr->returnValue=PasToZero(paramPtr, theError );
  2314.                      break;
  2315.             }
  2316.        }
  2317.  
  2318. }
  2319.  
  2320. /********************************/
  2321.  
  2322. -------------------------------------------------------------------------
  2323. Wade Williams                             "Any escape might help to smooth the
  2324. User Services Specialist            unattractive truth, but the suburbs
  2325. Academic Computing                     have no charms to soothe the restless
  2326. Auburn University                      dreams of youth." (N. Peart)
  2327. wadew@ducvax.auburn.edu
  2328. -------------------------------------------------------------------------
  2329.  
  2330. 
  2331. 
  2332. Path: ucivax!gateway
  2333. From: rsfinn@concerto.lcs.mit.edu ("Russell S. Finn")
  2334. Subject: Re: Bison & Flex
  2335. Message-ID: <9201180157.AA05136@concerto.lcs.mit.edu>
  2336. Newsgroups: fa.think-c
  2337. Lines: 23
  2338. X-Mts: smtp
  2339. Date: 18 Jan 92 01:57:41 GMT
  2340.  
  2341. I did the original port of Bison and Flex to THINK C 4.0 two years
  2342. ago, but have not done anything with it since then.
  2343.  
  2344. > Add the following includes to the begining of bison.simple:
  2345. > #include <stdlib.h>
  2346. > #include <string.h>
  2347.  
  2348. This will be necessary since THINK C 5.0 is fully ANSI-compliant.
  2349.  
  2350. > Also in bison.simple, search for bcopy and replace with memmove (3
  2351. > occurances), search for alloca and replace with malloc (3 occurances.)
  2352.  
  2353. This was also necessary, it turns out, in the originally posted
  2354. version, unless you take the implementation of "alloca" out of Bison
  2355. and include it with the code that uses the Bison output.  (Does that
  2356. make sense?)
  2357.  
  2358. If anyone else discovers something else that needs to be adjusted, I'd
  2359. appreciate knowing about it (although I'll see anything posted to this
  2360. list sooner or later).
  2361.  
  2362. -- Russell S. Finn
  2363. rsfinn@lcs.mit.edu
  2364. 
  2365. 
  2366. Path: ucivax!gateway
  2367. From: jjch@uranie.ais.berger-levrault.fr (John J Chew)
  2368. Subject: Re:  scroll panes
  2369. Message-ID: <9201171506.AA15983@uranie.AIS.Berger-Levrault.FR>
  2370. Newsgroups: fa.think-c
  2371. Lines: 53
  2372. Date: 18 Jan 92 04:37:11 GMT
  2373.  
  2374. In <9201161630.AA17975@seagull.math.byu.edu> Blake Fordham
  2375.   <blake@seagull.math.byu.edu> writes:
  2376.  
  2377. > I just started using TCL and I've run into a small idiosyncrasy that I
  2378. > can't track down.  I have a scroll pane with a CBitMapPane inside it.  When
  2379. > I scroll all the way to the right (or bottom), 2 problems show up:
  2380. >   First, the BitMapPane stops scrolling when it fit the window frame insted
  2381. > of the interior of the scroll pane,  so the 16 pixels on the edge don't show.
  2382. >   Second, if I then enlarge the window, the BitMapPane doesn't "stick" to
  2383. > the right and bottom edges so I get white rectangular regions on the edges
  2384. > of the bit map's picture.
  2385. >
  2386. > Has anyone had this happen to them?  What class methods do I need to adjust or
  2387. > rewrite?
  2388.  
  2389. Haven't noticed the first problem but the following code solves the second
  2390. problem for me:
  2391.  
  2392. /* ResizeFrame() - resize frame */
  2393. void CTerminalPane::ResizeFrame(Rect *delta)
  2394.     {
  2395.     short    height;
  2396.     long    left;
  2397.     Point    newposition;
  2398.     long    top;
  2399.     short    width;
  2400.  
  2401.     inherited::ResizeFrame(delta);
  2402.  
  2403.     GetFramePosition(&left, &top);
  2404.     GetFrameSpan(&width, &height);
  2405.  
  2406.     newposition.h = left;
  2407.     newposition.v = top;
  2408.     if (width > bounds.right) /* scrollpane is wider than panorama */
  2409.         newposition.h = 0;
  2410.     else if (left + width > bounds.right) /* ugly white space at right */
  2411.         newposition.h = bounds.right - width;
  2412.     if (height > bounds.bottom) /* scrollpane is taller than panorama */
  2413.         newposition.v = 0;
  2414.     else if (top + height > bounds.bottom) /* ugly white space at bottom */
  2415.         newposition.v = bounds.bottom - height;
  2416.     if (newposition.h != left || newposition.v != top)
  2417.         ScrollTo(newposition, TRUE);
  2418.     }
  2419.  
  2420. John
  2421. --
  2422. John J. Chew, III                            * jjchew@AIS.Berger-Levrault.FR
  2423. AIS/Berger-Levrault * phone +33 83 35 55 56  * poslfit@UTCS.UToronto.CA
  2424. 18, rue des Glacis  * fax   +33 83 37 56 72  * poslfit@utorgpu.bitnet
  2425. F-54017 Nancy Cedex * telex BL NANCY 960 212 * Berger.Lev.@AppleLink.Apple.Com
  2426. "Les arbres sont souvent en cause dans les accidents de la circulation."
  2427. 
  2428. 
  2429. Path: ucivax!gateway
  2430. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  2431. Subject: ProcPtr parameters v2
  2432. Message-ID: <9201181442.AA22142@chaos.cs.brandeis.edu>
  2433. In-Reply-To: "Mr. Neb"'s message of 13 Jan 92 20:44:37 GMT <01GF9TS77V9W0000KB@opie.bgsu.edu>
  2434. Newsgroups: fa.think-c
  2435. Lines: 42
  2436. Date: 18 Jan 92 14:44:46 GMT
  2437.  
  2438. >>>>> On 13 Jan 92 20:44:37 GMT, "Mr. Neb" <DNEBING@opie.bgsu.edu> said:
  2439.  >     This is the type of thing that I want to implement:
  2440.  
  2441.  > void foo(ProcPtr BarProc){
  2442.  >     int a;
  2443.  >     ...
  2444.  >     a=BarProc();
  2445.  >     ...
  2446.  > }
  2447.  
  2448.  > int BarOne(void){ }
  2449.  
  2450.  > int BarTwo(void){ }
  2451.  
  2452.  > main(){
  2453.  >     foo(BarOne);
  2454.  >     foo(BarTwo);
  2455.  > }
  2456.  
  2457. Instead of using the type "ProcPtr", you should create your own
  2458. procedure pointer type using a typedef statement. For example,
  2459.  
  2460.     typedef int (*BarProcPtr) (void);
  2461.  
  2462. This defines the typename "BarProcPtr" as a pointer to a function that
  2463. doesn't take any arguments and returns an integer. You can use it to
  2464. declare foo's argument:
  2465.  
  2466.     void foo(BarProcPtr barProc)
  2467.     {
  2468.         int a = barProc();
  2469.     }
  2470.  
  2471. I would recommend that you do not use the type "int", use "short" or
  2472. "long" instead. Using int will prevent you from porting your code
  2473. between THINK C and MPW C, if the need ever arises.
  2474.  
  2475.     -phil
  2476. ----
  2477.    Phil Shapiro                           Technical Support Analyst
  2478.    Language Products Group                     Symantec Corporation
  2479.         Internet: phils@chaos.cs.brandeis.edu
  2480. 
  2481. 
  2482. Path: ucivax!gateway
  2483. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  2484. Subject: When should I avoid breaking into the Think Debugger?
  2485. Message-ID: <9201181452.AA22180@chaos.cs.brandeis.edu>
  2486. In-Reply-To: Craig Hollabaugh's message of 13 Jan 92 16:50:55 GMT <9201131647.AA29469@monique.adgrp.gatech.edu>
  2487. Newsgroups: fa.think-c
  2488. Lines: 37
  2489. Date: 18 Jan 92 14:54:56 GMT
  2490.  
  2491. >>>>> On 13 Jan 92 16:50:55 GMT, Craig Hollabaugh <holla%monique@gatech.edu> said:
  2492.  
  2493. >>> Are there any points in a typical Mac application when I should avoid
  2494. >>> breaking into the Think Debugger?
  2495.  
  2496.  > Here is a debugging tip: Don't single step across Event functions.
  2497.  > I found that AcceptHighLevelEvent doesn't return appropriate values
  2498.  > if you stop before it and step across. Other Event functions
  2499.  > probably behave similiarly.  So my tip is put your stops after
  2500.  > Event functions.
  2501.  
  2502. Since the THINK C debugger (sort of) uses the Event Manager to switch
  2503. between your application and the debugger, you may "lose" events if
  2504. you try to step over a call to {Wait,Get}NextEvent, or the high-level
  2505. event manager routines.
  2506.  
  2507. If you want to avoid *crashing* the debugger, don't do this:
  2508.  
  2509.  - put a breakpoint/Debugger() statement in any bit of code that can
  2510.  execute at interrupt time, like a device completion routine (File
  2511.  Manager, Sound Manager, any PBxxx call). This also includes VBL or
  2512.  Slot Manager tasks.
  2513.  
  2514.  - put a breakpoint in any bit of code that can execute as part of a
  2515.  call to a non-reentrant toolbox manager. For example, don't put
  2516.  breakpoints in routines that may be called from your custom WDEF,
  2517.  since the Window Manager isn't reentrant.
  2518.  
  2519.  - don't try to put breakpoints inside, or step over, calls to
  2520.  OpenPicture, OpenRgn, and OpenPoly. These parts of QuickDraw are also
  2521.  non-reentrant.
  2522.  
  2523.     -phil
  2524. ----
  2525.    Phil Shapiro                           Technical Support Analyst
  2526.    Language Products Group                     Symantec Corporation
  2527.         Internet: phils@chaos.cs.brandeis.edu
  2528. 
  2529. 
  2530. Path: ucivax!gateway
  2531. From: gt0657c@prism.gatech.edu (geoff george)
  2532. Subject: ProcPtr parameters v2
  2533. Message-ID: <9201220643.AA28954@prism.gatech.edu>
  2534. Newsgroups: fa.think-c
  2535. Lines: 138
  2536. Date: 22 Jan 92 06:43:14 GMT
  2537.  
  2538. As I read the headers for Think C 5.01 (which are supposed to be the
  2539. same as those for the latest MPW, but which have conditional compiles in
  2540. them so TC stuff can differ from MPW stuff in a few cases), ProcPtr is
  2541. defined as (void *) in Types.h:
  2542.  
  2543.     typedef void *ProcPtr;
  2544.  
  2545. Under MPW, it's:
  2546.  
  2547.     typedef long (*ProcPtr)();
  2548.  
  2549. How you declare your functions depends on just what you want to do with
  2550. them. If you don't want to pass a function to toolbox calls, you can get
  2551. by with plain C declarations:
  2552.  
  2553.  
  2554.     void foo (int (* BarProc) (void));    /* declaration */
  2555.     void foo (int (* BarProc) (void)) {    /* definition, i.e. body */
  2556.             int a;
  2557.             ...
  2558.             a = BarProc ();    /* ANSI C allows this; old-style C
  2559.                    would require: a = (* BarProc) ();
  2560.                 */
  2561.     }
  2562.  
  2563.  
  2564.     int BarOne (void){        ...    }
  2565.     int BarTwo (void){        ...    }
  2566.  
  2567.     main(){
  2568.             foo (BarOne);    /* "foo (& BarOne)" would also be ok,
  2569.             foo (BarTwo);       just like with arrays */
  2570.             ...
  2571.     }
  2572.  
  2573.  
  2574. The precedence of operators in C requires the extra parentheses around
  2575. the parameter BarProc and its star.
  2576.  
  2577. If you want to have a function which is called by the toolbox and also
  2578. by your own code, declare it the way Inside Mac says to; e.g. for a
  2579. scroll bar action proc I use: (this is from working code; I actually
  2580. declared this particular routine static, but that's irrelevant)
  2581.  
  2582.     pascal void SBActionProc (ControlHandle sb, short part);
  2583.     pascal void SBActionProc (ControlHandle sb, short part) { ... }
  2584.  
  2585. Since the formal type of the third argument to the Toolbox trap
  2586. TrackControl() is ProcPtr, I call it like so:
  2587.  
  2588.     TrackControl (whichControl, where, (ProcPtr) SBActionProc);
  2589.  
  2590. Note the cast. This isn't needed with Think C, since ProcPtr is (void *)
  2591. and any pointer can be assigned to, or passed as, a (void *); but under
  2592. another C compiler (TC is all I've ever used on the Mac, by maybe one
  2593. day...) the cast might be required; it certainly would under MPW C,
  2594. where ProcPtr is defined as a pointer to a function taking unknown
  2595. arguments and returning a long. If I wanted to pass a pointer-to-
  2596. SBActionProc() to my own function which would then call it, I'd use:
  2597.  
  2598.  
  2599.     void foo (void (* barProc) (ControlHandle, short));
  2600.     void foo (void (* barProc) (ControlHandle, short)) {
  2601.         ControlHandle which; short part;
  2602.         ...
  2603.         (* barProc) (which, part);
  2604.         }
  2605.  
  2606.  
  2607.     foo (SBActionProc);        /* call in, say, main() */
  2608.  
  2609.  
  2610. or more readably:
  2611.  
  2612.  
  2613.     typedef void (* SBProc) (ControlHandle, short);
  2614.  
  2615.     void foo (SBProc barProc);
  2616.     void foo (SBProc barProc) {
  2617.         ControlHandle which; short part;
  2618.         ...
  2619.         (* barProc) (which, part);
  2620.         }
  2621.  
  2622.  
  2623.     foo (SBActionProc);        /* call in, say, main() */
  2624.  
  2625.  
  2626. This code (either case) preserves all type-checking of parameters, even
  2627. requiring that the signature of SBActionProc() match that of (* barProc)
  2628. (under TC 5; TC 4 wasn't so smart). I could declare the parameter
  2629. barProc to be a ProcPtr instead, but then I'd have to cast it to the
  2630. right function-pointer type before I could call the function it pointed
  2631. to. This would be ugly:
  2632.  
  2633.  
  2634.     void foo (ProcPtr barProc) {
  2635.     ...
  2636.     (* (void (*) (ControlHandle, short)) barProc) (which, part);
  2637.     }
  2638.  
  2639.  
  2640. or not quite so bad:
  2641.  
  2642.  
  2643.     typedef void (* ActionProcPtr) (ControlHandle, short);
  2644.  
  2645.     void foo (ProcPtr barProc) {
  2646.         ActionProcPtr app;
  2647.         ...
  2648.         app = (ActionProcPtr) barProc;
  2649.         app (which, part)
  2650.     }
  2651.  
  2652.  
  2653. In either of these last two cases you wouldn't get type-checking on the
  2654. parameter barProc, nor on the parameters you'd pass to the function
  2655. barProc points to; you've defeated the type-checking with casts, so that
  2656. if you were to call "foo (bar2)" where bar2() required three parameters,
  2657. bar2() would recieve garbage; foo() would put a ControlHandle and a
  2658. short on the stack, and bar2() would treat that space as though it
  2659. contained whatever its formal parameters where, resulting in chaos at
  2660. best and trashing memory at worst, depending on exactly what bar2() does
  2661. with its parameters. The compiler cannot warn you about this, as it can
  2662. in the third and fourth cases back.
  2663.  
  2664. Hope this helps. There might be typos, it's late; write back if you
  2665. suspect any, or have more questions.
  2666.  
  2667. geoff
  2668. --
  2669. geoff george    geoff@cc.gatech.edu        (my name)
  2670.             or  gt0657c@prism.gatech.edu   (a touch of warmth from GaTech OCS)
  2671.  
  2672. "Ordinary f---ing people - I hate 'em. Ordinary person spends his life
  2673. avoiding tense situations; repo man spends his life getting INTO tense
  2674. situations."
  2675.  
  2676. 
  2677. 
  2678. Path: ucivax!gateway
  2679. From: mcilroy_p_w_a%bt-web.bt.co.uk@bt-web.bt.co.uk (mcilroy_p_w_a)
  2680. Subject: Please Remove My Name from the THINK-C MAILING LIST
  2681. Message-ID: <9201221113.aa23112@q2.ics.uci.edu>
  2682. Newsgroups: fa.think-c
  2683. X-Vms-To: R11F::ICS.UCI.EDU::THINK-C
  2684. Lines: 11
  2685. Date: 22 Jan 92 19:13:23 GMT
  2686.  
  2687. From:    NAME: P W A MCILROY         [DNR33 ]
  2688.     FUNC: DNR33
  2689.     TEL: 0473-642572                      <MCILROY P W A AT WEB AT WEBCS>
  2690. To:    think-c@ics.uci.edu@unet
  2691.  
  2692.  
  2693. Please Remove My Name from the THINK-C MAILING LIST
  2694.  
  2695. Many thanks,
  2696.  
  2697. Paul McIlroy.
  2698. 
  2699. 
  2700. Path: ucivax!gateway
  2701. From: Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer)
  2702. Subject: CPrinter::GetPrintRecord()
  2703. Message-ID: <m0l6qqb-0003SXC@rsoft.bc.ca>
  2704. Newsgroups: fa.think-c
  2705. Lines: 11
  2706. Date: 23 Jan 92 08:05:05 GMT
  2707.  
  2708. The documentation for CPrinter::GetPrintRecord() states "other objects should
  2709. treat this record as read-only"...why?  Would it be a mistake to get the print
  2710. record and then set pIdleProc to my own procedure?  If so, what would be the
  2711. right way to do it?  Do I really have to override CDocument::MakePrinter() and
  2712. build my own print record?
  2713. --
  2714. -------------------------------------------------------------------
  2715.  Daryl Spitzer                    "Life isn't just, life just is."
  2716.  Vancouver, Canada                         -- Me  (I think.)
  2717.  Daryl_Spitzer@mindlink.bc.ca
  2718. -------------------------------------------------------------------
  2719. 
  2720. 
  2721. Path: ucivax!gateway
  2722. From: sink@zorro.cecer.army.mil ("Eric W. Sink")
  2723. Subject: Flex and Byacc
  2724. Message-ID: <9201231835.AA16704@zorro.cecer.army.mil>
  2725. X-Mailer: ELM [version 2.3 PL11]
  2726. Newsgroups: fa.think-c
  2727. Lines: 10
  2728. Date: 23 Jan 92 18:34:47 GMT
  2729.  
  2730. Someone mentioned doing ports of flex and byacc to Think C 5,
  2731. from the 4.0 versions.  Did anyone finish this ?  How about
  2732. a port of flex 2.3 (the Mac version is 2.1 beta)?
  2733.  
  2734. Just curious...
  2735.  
  2736. --
  2737. Eric W. Sink,  Spatial Analysis and Systems Team
  2738. USACERL, P.O. Box 9005, Champaign, IL 61826-9005
  2739. 1-800-USA-CERL x449,   e-sink@uiuc.edu
  2740. 
  2741. 
  2742. Path: ucivax!gateway
  2743. From: asaria@rrdtc.donnelley.com
  2744. Subject: Host-id and Crypt
  2745. Message-ID: <9201231858.AA18666@uu.psi.com>
  2746. Newsgroups: fa.think-c
  2747. Lines: 20
  2748. Date: 23 Jan 92 19:00:50 GMT
  2749.  
  2750.  
  2751. Two questions:
  2752.  
  2753.     1.  Is there a Macintosh equivalent to the host-id that is available
  2754.         on the Sun?  Is there a toolbox call that can be used to
  2755.         get this string?
  2756.  
  2757.         On the Sun, the host-id is a string that is embedded in the ROM
  2758.         (I believe) and can be used to uniquely identify a workstation.
  2759.         I'm trying to find out if the Mac's ROM has an id string encoded
  2760.         into it that is unique to each Mac and if so, how to get it.
  2761.  
  2762.     2.    Is there something comparable to the Unix crypt/decrypt systems calls
  2763.         available on the Mac?  Has anyone ported the Unix crypt command?
  2764.  
  2765.  
  2766. Thanks.
  2767.  
  2768. Riyaz
  2769. asaria@donnelley.com
  2770. 
  2771. 
  2772. Path: ucivax!gateway
  2773. From: wadew@ducvax.auburn.edu (Wade Williams)
  2774. Subject: XCMDs and XFCNs
  2775. Message-ID: <9201232015.AA09113@accs.duc.auburn.edu>
  2776. Newsgroups: fa.think-c
  2777. Lines: 22
  2778. Date: 23 Jan 92 20:08:52 GMT
  2779. X-Envelope-to: think-c@ics.uci.edu
  2780.  
  2781. Two questions:
  2782.  
  2783. The HyperCard Scripting guide says that XCMDs cannot use string literals.
  2784. Does that mean I can't use a statement like:
  2785.  
  2786. StringPtr  theError;
  2787.  
  2788. theError=(StringPtr)"\pError:  Disk Full";
  2789.  
  2790. Also, it says that string literals *can* be used when compiled in MPW 3.0
  2791. or later with the -b switch.  How does that apply to THINK C 5.0.2?
  2792.  
  2793.  
  2794.  
  2795. -------------------------------------------------------------------------
  2796. Wade Williams                             "Any escape might help to smooth the
  2797. User Services Specialist            unattractive truth, but the suburbs
  2798. Academic Computing                     have no charms to soothe the restless
  2799. Auburn University                      dreams of youth." (N. Peart)
  2800. wadew@ducvax.auburn.edu
  2801. -------------------------------------------------------------------------
  2802.  
  2803. 
  2804. 
  2805. Path: ucivax!gateway
  2806. From: jonas@meryl.csd.uu.se (Jonas Barklund)
  2807. Subject: Flex and Byacc
  2808. Message-ID: <9201232158.AA19053@meryl.csd.uu.se>
  2809. In-Reply-To: Eric W. Sink's message of 23 Jan 92 18:34:47 GMT <9201231835.AA16704@zorro.cecer.army.mil>
  2810. Newsgroups: fa.think-c
  2811. Lines: 7
  2812. Date: 23 Jan 92 22:02:51 GMT
  2813.  
  2814. I have ported flex.2.3.7 to Think C 4.0. I have had no trouble
  2815. using the application also together with Think C 5.0.
  2816. If noone else has already done this, and uploaded it somewhere
  2817. reachable I will be happy to do so.
  2818.  
  2819. Jonas Barklund, Computing Science Department, Uppsala University
  2820. Email jonas@csd.uu.se, phone +46-18-181050, fax +46-18-521270
  2821. 
  2822. 
  2823. Path: ucivax!gateway
  2824. From: jeg@netcom.netcom.com ("Julian E. Gomez")
  2825. Subject: THC 502 updater
  2826. Message-ID: <9201240300.AA06793@netcom.netcom.com>
  2827. Newsgroups: fa.think-c
  2828. Lines: 4
  2829. Date: 24 Jan 92 03:00:11 GMT
  2830.  
  2831. Has anyone found the trick to make the TCL updater work properly?
  2832. No matter what I do I end up with a new folder instead of having
  2833. the files replaced. I even tried it with a freshly installed copy
  2834. from the 5.0 disks.
  2835. 
  2836. 
  2837. Path: ucivax!gateway
  2838. From: potts@itl.itd.umich.edu (Paul Potts)
  2839. Subject: Re:  THC 502 updater
  2840. Message-ID: <9201241353.AA04921@itl.itd.umich.edu>
  2841. Newsgroups: fa.think-c
  2842. Lines: 13
  2843. Date: 24 Jan 92 13:53:34 GMT
  2844.  
  2845.  
  2846. The trick is, before clicking "extract," go to inside the top-level folder
  2847. of the THINK C package. If you have followed the manual, you have a folder
  2848. called "Development" or something like that with a "THINK C 5.0 Folder,"
  2849. "TCL 1.1 Demos," "THINK C 5.0 Demos," and "THINK C 5.0 Utilites" in it.
  2850. Extract while set to your "Development" folder.
  2851. The extracter will then give you a couple of options for replacing files:
  2852. replace just the first one, or replace them all. You want to replace them
  2853. all. It will find the 33 or so files and replace them.
  2854. This is, by the way, all clearly stated in the README file that comes with
  2855. the updater.
  2856. -Paul Potts-
  2857. potts@itl.itd.umich.edu
  2858. 
  2859. 
  2860. Path: ucivax!gateway
  2861. From: potts@itl.itd.umich.edu (Paul Potts)
  2862. Subject: THC 502 updater
  2863. Message-ID: <9201241503.AA05011@itl.itd.umich.edu>
  2864. Newsgroups: fa.think-c
  2865. Lines: 10
  2866. Date: 24 Jan 92 15:02:56 GMT
  2867.  
  2868.  
  2869. Sorry, when I said
  2870. >The extracter will then give you a couple of options for replacing files:
  2871. replace just the first one, or replace them all. You want to replace them
  2872. all.
  2873.  
  2874. By "all" I meant "all the files which it is meant to replace," not
  2875. "all the files in the TCL." Oops... : >
  2876.  
  2877. -Paul-
  2878. 
  2879. 
  2880. Path: ucivax!gateway
  2881. From: cmacfarl@chateau-rouge.ICS.UCI.EDU (Craig MacFarlane)
  2882. Subject: Quicktime and Think C
  2883. Message-ID: <9201240938.aa25610@Paris.ics.uci.edu>
  2884. Newsgroups: fa.think-c
  2885. Lines: 9
  2886. Date: 24 Jan 92 17:38:33 GMT
  2887.  
  2888. I'd like to incorporate Quicktime shorts into a piece of software that
  2889. I am developing.  Does anybody know where to get some documentation
  2890. on how to use Quicktime?  I have the interfaces from ftp.apple.com, but
  2891. there is no documentation from Apple to go along with them.  Can these
  2892. interfaces be used without modification with Think C?
  2893.  
  2894. Thanks,
  2895. Craig MacFarlane
  2896. cmacfarl@paris.ics.uci.edu
  2897. 
  2898. 
  2899. Path: ucivax!gateway
  2900. From: johncc@picea.cfnr.colostate.edu (John Cartwright)
  2901. Subject: SFGetfile, SFPutfile
  2902. Message-ID: <9201241833.AA14315@picea>
  2903. Newsgroups: fa.think-c
  2904. Lines: 10
  2905. Date: 25 Jan 92 18:21:09 GMT
  2906.  
  2907.  
  2908. Hello all,
  2909.  
  2910. I am an extremely novice programmer, but I am looking for a simple example of
  2911. how to use SFGetfile and SFPutfile in a program that opens a user-specified
  2912. text file, does some processing, and then writes out to a user-specified text
  2913. file.  Nothing fancy at all.  Any suggestions would be most appreciated!
  2914.  
  2915. --john
  2916. johncc@picea.cfnr.colostate.edu
  2917. 
  2918. 
  2919. Path: ucivax!gateway
  2920. From: cmiller@laurel (Craig Miller)
  2921. Subject: The SPLAsh Story?
  2922. Message-ID: <9201271652.AA09697@laurel.umass.edu>
  2923. Newsgroups: fa.think-c
  2924. Lines: 33
  2925. Date: 27 Jan 92 16:49:42 GMT
  2926.  
  2927. To:  Greg Dow
  2928.      SPLAsh Resources
  2929.      Splash@AppleLink.Apple.com
  2930.  
  2931. cc:  think-c@ics.uci.edu
  2932.      (the Think C mailing list)
  2933. Dear Greg,
  2934.  
  2935. What's the story?  After joining this "association"
  2936. last summer with hopes and interest and a payment
  2937. of a very reasonable $30 or so, I have received
  2938. exactly one thing:  a beautiful little blue
  2939. membership card stating that I am member #1826,
  2940. have been a member since "Sep 91", "Good Thru Sep
  2941. 92", and finally "Last Issue  #7".  Nothing else.
  2942. No other communication, no issues of anything.
  2943. On the other hand, I have heard stories of similar
  2944. non-communication via email.
  2945.  
  2946. I am not angry, just disappointed.
  2947.  
  2948. It would be very helpful for me and others to hear
  2949. from you.  What's the real story?  Who are you,
  2950. what have you done, what are you doing, what are
  2951. your plans for the future of this "assocation"?
  2952.  
  2953. Sincerely,
  2954. -----------------------------------------------------------------------
  2955. Craig D. Miller, Computer Programmer          \  cmiller@math.umass.edu
  2956. Scientific Reasoning Research Institute (SRRI) \      tel. 413-545-5865
  2957. 306 Hasbrouck Lab                               \
  2958. University of Massachusetts, Amherst, MA  01003  \                  USA
  2959. -----------------------------------------------------------------------
  2960. 
  2961. 
  2962. Path: ucivax!gateway
  2963. From: holla%monique@gatech.edu (Craig Hollabaugh)
  2964. Subject: setjmp, longjmp, and objects
  2965. Message-ID: <9201271745.AA26506@monique.adgrp.gatech.edu>
  2966. Newsgroups: fa.think-c
  2967. Lines: 16
  2968. Date: 27 Jan 92 17:49:13 GMT
  2969.  
  2970.  
  2971. Folks,
  2972. Standard Libraries Reference page 260 (setjmp) note says
  2973. you can't use setjmp() and longjmp() in object methods.
  2974.  
  2975. why is that? I have found that mallocs after the longjmp
  2976. tend to bomb, which leads me to believe that memory allocation,
  2977. indirect object classes, and the longjmp aren't compatible.
  2978.  
  2979. If someone could offer insight I would appreciate it. I have
  2980. a large simulation program that uses setjmp/longjmp for error
  2981. handling and only recently discovered that it won't work. ugh!!
  2982.  
  2983. Craig Hollabaugh
  2984. Analog Microelectronics, Georgia Tech
  2985. holla@monique.adgrp.gatech.edu
  2986. 
  2987. 
  2988. Path: ucivax!gateway
  2989. From: rick_holzgrafe@gateway.qm.apple.com (Rick Holzgrafe)
  2990. Subject: What's in the 5.0.2 update?
  2991. Message-ID: <9201271804.AA11079@internal.apple.com>
  2992. Newsgroups: fa.think-c
  2993. Lines: 14
  2994. Date: 27 Jan 92 18:05:40 GMT
  2995.  
  2996.  Internet Mail          What's in the 5.0.2 update?
  2997. I have a project near completion that uses ThC 5.0.1 and the accompanying
  2998. upgrade to the TCL. I'm a little nervous about upgrading to 5.0.2 this late in
  2999. the game. Does anyone have a list of the changes it makes to the TCL?
  3000.  
  3001. -----------------------------------------------------
  3002. Rick Holzgrafe   rmh@apple.com   AppleLink HOLZGRAFE1
  3003.      {sun,voder,nsc,mtxinu,dual}!apple!rmh
  3004. Apple Computer, Inc.
  3005. 20525 Mariani Ave. MS: 3-PK
  3006. Cupertino, CA 95014
  3007.  
  3008.  
  3009.  
  3010. 
  3011. 
  3012. Path: ucivax!gateway
  3013. From: rick_holzgrafe@gateway.qm.apple.com (Rick Holzgrafe)
  3014. Subject: "Cursed" Source File
  3015. Message-ID: <9201271816.AA11589@internal.apple.com>
  3016. Newsgroups: fa.think-c
  3017. Lines: 36
  3018. Date: 27 Jan 92 18:20:44 GMT
  3019.  
  3020.  Internet Mail          "Cursed" Source File
  3021. A bug in a recent project of mine was trashing memory that didn't belong to it
  3022. - all too easy to do on the Mac. I fixed the bug, but I started having frequent
  3023. crashes in Think C, even after a reboot and before trying to run any of my
  3024. code. For a long time I suspected that the project file had been trashed by the
  3025. old bug, but repeated efforts to create a guaranteed brand-new, clean,
  3026. built-from-scratch, uncorrupted project file didn't seem to help. Eventually I
  3027. realized that the symptoms always seemed to occur during or after editing one
  3028. particular source file.
  3029.  
  3030. I think I've finally exorcised the demon: the resources in the source file were
  3031. corrupt. These resources include the list of markers for the file, and perhaps
  3032. other things as well. After I used ResEdit to remove all resources from that
  3033. file, the troubles went away and have not recurred.
  3034.  
  3035. The symptoms: Various kinds of funny behavior from Think C, including
  3036. mysterious crashes, demands to "remove objects" from a project file so new that
  3037. it has never had any, bombs while running your code under the debugger that
  3038. occur BEFORE your code actually starts up, "Bad ZREF" complaints, and others.
  3039. One symptom seems very characteristic: the text in the affected source file
  3040. keeps getting subtly corrupted, as little one- to four-byte chunks of text get
  3041. replaced with one- to four-byte chunks of garbage.
  3042.  
  3043. So this is a cautionary tale: Think C has fragile project files AND fragile
  3044. source files that can be corrupted in persistent ways. Be careful.
  3045.  
  3046. -----------------------------------------------------
  3047. Rick Holzgrafe   rmh@apple.com   AppleLink HOLZGRAFE1
  3048.      {sun,voder,nsc,mtxinu,dual}!apple!rmh
  3049. Apple Computer, Inc.
  3050. 20525 Mariani Ave. MS: 3-PK
  3051. Cupertino, CA 95014
  3052.      --- My opinions, not Apple's.
  3053.  
  3054.  
  3055.  
  3056. 
  3057. 
  3058. Path: ucivax!gateway
  3059. From: yangq@cs.wmich.edu (Qingkuang Yang)
  3060. Subject: (none)
  3061. Message-ID: <9201280331.AA09792@cs.wmich.edu>
  3062. Newsgroups: fa.think-c
  3063. Lines: 1
  3064. Date: 28 Jan 92 03:32:02 GMT
  3065.  
  3066. subscribe Yang Qing-Kuang
  3067. 
  3068. 
  3069. Path: ucivax!gateway
  3070. From: jbr@cblph.att.com
  3071. Subject: (none)
  3072. Message-ID: <9201280440.aa25554@q2.ics.uci.edu>
  3073. Newsgroups: fa.think-c
  3074. Original-From: cblph!jbr (j.a.brownlee)
  3075. Lines: 36
  3076. Date: 28 Jan 92 12:40:37 GMT
  3077.  
  3078. The limitations of the Mac's Memory Manager with respect to allocating many
  3079. pieces of memory have recently been discussed again on c.s.m.p.  The timing
  3080. of the discussion coincides with a problem I am having using the TCL to create
  3081. a lot of objects.  Before I outline the problem, let me mention that I'm using
  3082. TC 5.0.1 (not 5.0.2 yet) on an 8 MB IIcx.
  3083.  
  3084. My project creates one primary object that the user can edit.  It is an
  3085. aggregation of about 3000 small objects, most taking up only a few bytes.
  3086. Of course, doing this the standard way with indirect objects is unbearably
  3087. slow, and gets slower and slower as more objects are allocated, which is the
  3088. behavior one expects from the Memory Manager in such a situation.
  3089.  
  3090. My question is this: what is the best approach in TCL to get around this
  3091. problem?  I'd like a solution that is efficient, but that does not mess up the
  3092. encapsulation of the objects too badly.  For example, one solution I thought
  3093. of is to have the primary object allocate enough memory for all the smaller
  3094. objects and then parcel it out as the small objects are created.  The two
  3095. problems I see are that it would be tricky to allocate the memory in a
  3096. relocatable block (which I'd like to do, if possible) and have all of the
  3097. smaller objects get at the master pointer in the primary object.  Also, the
  3098. primary object might have to know too much about the smaller ones for my
  3099. comfort.  Would it be helpful to write my own new() in these cases?
  3100.  
  3101. One problem that complicates trying to do this in a modular way is the fact
  3102. that in TC 5.x, you can no longer use sizeof() on classes or objects.  I'm not
  3103. exactly sure why this limitation was added, but it has been very annoying to
  3104. me on several occasions.  I suppose one way to get around this is to wrap
  3105. each object's data members inside a structure, on which I can use sizeof().
  3106. This is a hassle, but it should be a practical solution.
  3107.  
  3108. Thanks in advance for any advice you can offer, everyone!
  3109.  
  3110.    ^      _   Joe Brownlee, Analysts International Corporation @ AT&T Bell Labs
  3111.   /_\  @ / `  471 E Broad St, Suite 2001, Columbus, Ohio 43215   (614) 860-7461
  3112.  /   \ | \_,  E-mail: jbr@cblph.att.com     Who pays attention to what _I_ say?
  3113.  "Scotty, we need warp drive in 3 minutes or we're all dead!" --- James T. Kirk
  3114. 
  3115. 
  3116. Path: ucivax!gateway
  3117. From: campbell@inf.ethz.ch (Iain Campbell)
  3118. Subject: MacTCP routines for Think C 5.0
  3119. Message-ID: <9201281906.AA07364@orion.inf.ethz.ch>
  3120. Newsgroups: fa.think-c
  3121. Lines: 48
  3122. Date: 28 Jan 92 19:06:45 GMT
  3123.  
  3124.  
  3125. Hi !
  3126.  
  3127. SHORT FORM:
  3128.  
  3129.    I'm trying to port some of my Unix/C code to the Mac.
  3130.  
  3131.    The code implements a information retrieval server on a TCP port.
  3132.  
  3133.    I need C routines to allow me to use the MacTCP drivers - can anyone
  3134. help ?
  3135.  
  3136.  
  3137.  
  3138. VERBOSE FORM:
  3139.  
  3140. I want simple routines to build connections and transfer blocks of data.
  3141.  
  3142. I've tried to get MacTCP to work with the code from Eudora, but that code
  3143. does
  3144. a lot of fancy stuff and I can't figure it all out.
  3145.  
  3146. I tried stripping the Eudora code to the bones and managed to get the
  3147. MacTCP driver
  3148. initialised, open a connection to a remote Unix box, but can't get it to
  3149. send data
  3150. or close the connection without 'hanging' my Mac.
  3151.  
  3152. Is there an Apple library or some such thing ?
  3153.  
  3154. I've now spent several days hacking, and have had enough, I give in, please
  3155. help !!
  3156.  
  3157. (Mac IIfx, System 7.0.0, MacTCP 1.1, Think C 5.0, Mac Programming
  3158. Experience ver 0.0.0)
  3159.  
  3160.  
  3161. ===========================================================================
  3162. Iain Campbell                                          campbell@inf.ethz.ch
  3163. Radio Schweiz AG
  3164. Laupenstrasse 18a                                    Tel: +41 (0)31 509 855
  3165. CH-3008 Bern       (but I'm NOT Swiss)               Fax: +41 (0)31 509 675
  3166. ---------------------------------------------------------------------------
  3167. Even non-Scotsmen, without a word of Gaelic in there heads, can be heard
  3168. refering to their "whisky" by its original Gaelic "uisge" within a couple
  3169. of drams. What other spirit can claim such linguistic impartation?
  3170. ===========================================================================
  3171.  
  3172. 
  3173. 
  3174. Path: ucivax!gateway
  3175. From: tv0c+@andrew.cmu.edu (Thomas Edward Van Lenten)
  3176. Subject: Creating Windows
  3177. Message-ID: <gdVjOYS00WC=8VQ0hP@andrew.cmu.edu>
  3178. Newsgroups: fa.think-c
  3179. Lines: 15
  3180. Date: 29 Jan 92 18:52:22 GMT
  3181.  
  3182. I'm starting up a project in Think C 5, and was wondering if there is
  3183. some easy way to create a window full of views.  The only option I see
  3184. right now is to create the views one at a time, by hand in the code.  I
  3185. was thinking of writting a function like the one in MacAPP that will
  3186. create the window and subviews from a 'view' rsrc; but there is no way
  3187. to create an object by name.  Has anyone else done something like this
  3188. who could point me in the right direction?
  3189.  
  3190. TVL
  3191. =========================================================
  3192.  Tom Van Lenten                         Special Projects
  3193.  tv0c@andrew.cmu.edu          Carnegie Mellon University
  3194.  bitnet%"tv0c@andrew"                     Pittsburgh, PA
  3195. =========================================================
  3196.  
  3197. 
  3198. 
  3199. Path: ucivax!gateway
  3200. From: rsfinn@joplin.lcs.mit.edu ("Russell S. Finn")
  3201. Subject: Re: Creating Windows
  3202. Message-ID: <9201300103.AA02470@joplin.lcs.mit.edu>
  3203. In-Reply-To: Your message of "29 Jan 92 18:52:22 GMT."
  3204.              <gdVjOYS00WC=8VQ0hP@andrew.cmu.edu>
  3205. Newsgroups: fa.think-c
  3206. Lines: 22
  3207. X-Mts: smtp
  3208. Date: 30 Jan 92 01:05:05 GMT
  3209.  
  3210. > I'm starting up a project in Think C 5, and was wondering if there is
  3211. > some easy way to create a window full of views.  The only option I see
  3212. > right now is to create the views one at a time, by hand in the code.  I
  3213. > was thinking of writting a function like the one in MacAPP that will
  3214. > create the window and subviews from a 'view' rsrc; but there is no way
  3215. > to create an object by name.  Has anyone else done something like this
  3216. > who could point me in the right direction?
  3217.  
  3218. First of all, in TCL you probably want to create "panes", not "views";
  3219. the confusion in terminology is unfortunate, but in TCL "views" are
  3220. abstract classes for "things that appear on the screen", which include
  3221. windows as well.
  3222.  
  3223. Secondly, there already are functions to create panes (and many
  3224. objects that descend from them) from resources; see the definition of
  3225. CPane::IPaneRes (which uses a 'Pane' resource), and the discussion of
  3226. this topic in an early chapter of the Object-Oriented Programming
  3227. Reference (I don't have it in front of me, but it's the "How to use
  3228. the TCL" chapter -- 6, perhaps?).
  3229.  
  3230. -- Russell S. Finn
  3231. rsfinn@lcs.mit.edu
  3232. 
  3233. 
  3234. Path: ucivax!gateway
  3235. From: tv0c+@andrew.cmu.edu (Thomas Edward Van Lenten)
  3236. Subject: Re: Creating Windows
  3237. Message-ID: <cdVrC=W00WC=QWEGcG@andrew.cmu.edu>
  3238. In-Reply-To: <9201300103.AA02470@joplin.lcs.mit.edu>
  3239. Newsgroups: fa.think-c
  3240. Lines: 23
  3241. Date: 30 Jan 92 03:41:01 GMT
  3242.  
  3243. Excerpts from mail: 29-Jan-92 Re: Creating Windows "Russell S.
  3244. Finn"@joplin (1121)
  3245. >Secondly, there already are functions to create panes (and many
  3246. >objects that descend from them) from resources; see the definition of
  3247. >CPane::IPaneRes (which uses a 'Pane' resource), and the discussion of
  3248. >this topic in an early chapter of the Object-Oriented Programming
  3249. >Reference (I don't have it in front of me, but it's the "How to use
  3250. >the TCL" chapter -- 6, perhaps?).
  3251.  
  3252. I know about this.  What I'm interested in doing is making a resource
  3253. that says 'put a pane of type CMyPane at this rect, and type CMyButton
  3254. at this rect'.  Hence my problem is how to take the name of the class
  3255. ('CMyPane'), and create an object of that type on the fly.  Other
  3256. compilers have a method to create an object by name (a new() that takes
  3257. a Str255 as the parameter).  This is the ability that I'm trying to get.
  3258.  
  3259. TVL
  3260. =========================================================
  3261.  Tom Van Lenten                         Special Projects
  3262.  tv0c@andrew.cmu.edu          Carnegie Mellon University
  3263.  bitnet%"tv0c@andrew"                     Pittsburgh, PA
  3264. =========================================================
  3265.  
  3266. 
  3267. 
  3268. Path: ucivax!gateway
  3269. From: slosser@mindseye.berkeley.edu (Eric Slosser)
  3270. Subject: SPLAsh
  3271. Message-ID: <9201300835.AA12116@mindseye.berkeley.edu>
  3272. In-Reply-To: Daryl Spitzer's message of 16 Jan 92 20:38:22 GMT <m0l4dAj-00024wC@rsoft.bc.ca>
  3273. Newsgroups: fa.think-c
  3274. Lines: 3
  3275. Date: 30 Jan 92 08:34:37 GMT
  3276.  
  3277. I'm a member, and consider it to be a decent programmer's
  3278. magazine.  It's production schedule is a little erratic,
  3279. but then, so is mine.
  3280. 
  3281. 
  3282. Path: ucivax!gateway
  3283. From: jonas@meryl.csd.uu.se (Jonas Barklund)
  3284. Subject: Bug in fprint with minimum field width?
  3285. Message-ID: <9201300853.AA16442@meryl.csd.uu.se>
  3286. Newsgroups: fa.think-c
  3287. Lines: 50
  3288. Date: 30 Jan 92 08:53:36 GMT
  3289.  
  3290. The program below contains the lines
  3291.  
  3292.   printf("%5d", value);
  3293.   width = 5;
  3294.   printf("%*d", width, value);
  3295.  
  3296. which are said in Harbison & Steele, 3rd ed., to result in the same
  3297. output.  Under Think C 5.0 they do not; in fact neither of them
  3298. produces the expected output.  Here is the full program.
  3299.  
  3300. #include <stdio.h>
  3301.  
  3302. void main()
  3303. {
  3304.   int width;
  3305.   int value = 42;
  3306.  
  3307.   printf("%5d", value);
  3308.   width = 5;
  3309.   printf("%*d", width, value);
  3310.  
  3311.   putchar('\n');
  3312.  
  3313. }
  3314.  
  3315. When run with Think C it produces the following output:
  3316.  
  3317.     05
  3318.  
  3319. (without a trailing newline).
  3320.  
  3321. When run with, for example, gcc on a SUN it produces the following
  3322. output, which is what I would expect.
  3323.  
  3324.    42   42
  3325.  
  3326. To make things even worse, when I add the line
  3327.  
  3328.   fprintf(stderr, "mu!\n");
  3329.  
  3330. after the call to putchar, the program crashes with an illegal
  3331. instruction exception. This indicates that the I/O system gets
  3332. severely damaged. (Under gcc it prints "mu!" on the console, as
  3333. expected.)
  3334.  
  3335. I have not applied the 5.01 or 5.02 upgrades. Is this problem fixed in
  3336. one of them?
  3337.  
  3338. Jonas Barklund, Computing Science Department, Uppsala University
  3339. Email jonas@csd.uu.se, phone +46-18-181050, fax +46-18-521270
  3340. 
  3341. 
  3342. Path: ucivax!gateway
  3343. From: jonas@meryl.csd.uu.se (Jonas Barklund)
  3344. Subject: Bug in fprint with minimum field width?
  3345. Message-ID: <9201300914.AA16671@meryl.csd.uu.se>
  3346. In-Reply-To: Jonas Barklund's message of Thu, 30 Jan 92 09:53:15 +0100 <9201300853.AA16442@meryl.csd.uu.se>
  3347. Newsgroups: fa.think-c
  3348. Lines: 7
  3349. Date: 30 Jan 92 09:15:44 GMT
  3350.  
  3351. Sorry, my mistake. By accident I had turned on "4 byte ints" but was
  3352. using the usual ANSI library. I really wish that one could be told
  3353. automagically that one's choice of ANSI library is incompatible with
  3354. one's choice of int width. Then I would love Think C even more...
  3355.  
  3356. Jonas Barklund, Computing Science Department, Uppsala University
  3357. Email jonas@csd.uu.se, phone +46-18-181050, fax +46-18-521270
  3358. 
  3359. 
  3360. Path: ucivax!jhummel
  3361. From: jhummel@wave.ics.uci.edu (Joseph Edward Hummel)
  3362. Subject: Re: Bug in fprint with minimum field width?
  3363. Nntp-Posting-Host: wave.ics.uci.edu
  3364. Message-ID: <2987C336.9594@ics.uci.edu>
  3365. Newsgroups: fa.think-c
  3366. Reply-To: jhummel@ics.uci.edu (Joseph Edward Hummel)
  3367. Organization: UC Irvine Department of ICS
  3368. Lines: 59
  3369. Date: 30 Jan 92 09:19:51 GMT
  3370. References: <9201300853.AA16442@meryl.csd.uu.se>
  3371.  
  3372. In article <9201300853.AA16442@meryl.csd.uu.se> jonas@meryl.csd.uu.se (Jonas Barklund) writes:
  3373. >The program below contains the lines
  3374. >
  3375. >  printf("%5d", value);
  3376. >  width = 5;
  3377. >  printf("%*d", width, value);
  3378. >
  3379. >which are said in Harbison & Steele, 3rd ed., to result in the same
  3380. >output.  Under Think C 5.0 they do not; in fact neither of them
  3381. >produces the expected output.  Here is the full program.
  3382. >
  3383. >#include <stdio.h>
  3384. >void main()
  3385. >{
  3386. >  int width;
  3387. >  int value = 42;
  3388. >
  3389. >  printf("%5d", value);
  3390. >  width = 5;
  3391. >  printf("%*d", width, value);
  3392. >
  3393. >  putchar('\n');
  3394. >
  3395. >}
  3396. >
  3397. >When run with Think C it produces the following output:
  3398. >
  3399. >    05
  3400. >
  3401. >(without a trailing newline).
  3402. >
  3403. >When run with, for example, gcc on a SUN it produces the following
  3404. >output, which is what I would expect.
  3405. >
  3406. >   42   42
  3407. >
  3408. >To make things even worse, when I add the line
  3409. >
  3410. >  fprintf(stderr, "mu!\n");
  3411. >
  3412. >after the call to putchar, the program crashes with an illegal
  3413. >instruction exception. This indicates that the I/O system gets
  3414. >severely damaged. (Under gcc it prints "mu!" on the console, as
  3415. >expected.)
  3416. >
  3417. >I have not applied the 5.01 or 5.02 upgrades. Is this problem fixed in
  3418. >one of them?
  3419.  
  3420. I'm running 5.02, and THINK C works exactly as gcc does (as it should
  3421. in this case).  I can't explain the behavior you saw, except that you
  3422. should upgrade :-)  Actually, I suspect it is something else... (like
  3423. old version of ANSI library in your project?)
  3424.  
  3425.   - joe
  3426.  
  3427. --
  3428. Joe Hummel
  3429. ICS Graduate Student, UC Irvine
  3430. Internet: jhummel@ics.uci.edu
  3431. 
  3432. 
  3433. Path: ucivax!gateway
  3434. From: rsfinn@concerto.lcs.mit.edu ("Russell S. Finn")
  3435. Subject: Re: Creating Windows
  3436. Message-ID: <9201301136.AA03104@concerto.lcs.mit.edu>
  3437. In-Reply-To: Your message of "30 Jan 92 03:41:01 GMT."
  3438.              <cdVrC=W00WC=QWEGcG@andrew.cmu.edu>
  3439. Newsgroups: fa.think-c
  3440. Lines: 26
  3441. X-Mts: smtp
  3442. Date: 30 Jan 92 11:37:11 GMT
  3443.  
  3444. > >Secondly, there already are functions to create panes (and many
  3445. > >objects that descend from them) from resources; see the definition of
  3446. > >CPane::IPaneRes (which uses a 'Pane' resource), ...
  3447. >
  3448. > I know about this.  What I'm interested in doing is making a resource
  3449. > that says 'put a pane of type CMyPane at this rect, and type CMyButton
  3450. > at this rect'.  Hence my problem is how to take the name of the class
  3451. > ('CMyPane'), and create an object of that type on the fly.  Other
  3452. > compilers have a method to create an object by name (a new() that takes
  3453. > a Str255 as the parameter).  This is the ability that I'm trying to get.
  3454.  
  3455. Sorry, I must have misunderstood what you were asking.
  3456.  
  3457. THINK C 5.0 has this capability also, with the "new_by_name" function
  3458. (it takes a char * instead of a Str255, but this *is* C after all :-).
  3459.  
  3460. For an example of using this, you may want to take a look at the
  3461. implementation of the CDLOGDirector class in the THINK Class Library
  3462. version 1.1, which has the ability to create a pane of an arbitrary
  3463. class in a dialog by specifying the name of the class in a static text
  3464. item in a 'DITL' resource.  (You'll have to read the source; it's one
  3465. of the "extra" undocumented classes.)
  3466.  
  3467. -- Russell S. Finn
  3468. rsfinn@lcs.mit.edu
  3469.  
  3470. 
  3471. 
  3472. Path: ucivax!gateway
  3473. From: Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer)
  3474. Subject: Re: Creating Windows
  3475. Message-ID: <m0l9eSa-0001sFC@rsoft.rsoft.bc.ca>
  3476. Newsgroups: fa.think-c
  3477. Lines: 22
  3478. Date: 30 Jan 92 17:38:04 GMT
  3479.  
  3480. > >Secondly, there already are functions to create panes (and many
  3481. > >objects that descend from them) from resources; see the definition of
  3482. > >CPane::IPaneRes (which uses a 'Pane' resource), and the discussion of
  3483. > >this topic in an early chapter of the Object-Oriented Programming
  3484. > >Reference (I don't have it in front of me, but it's the "How to use
  3485. > >the TCL" chapter -- 6, perhaps?).
  3486. >
  3487. > I know about this.  What I'm interested in doing is making a resource
  3488. > that says 'put a pane of type CMyPane at this rect, and type CMyButton
  3489. > at this rect'.  Hence my problem is how to take the name of the class
  3490. > ('CMyPane'), and create an object of that type on the fly.  Other
  3491. > compilers have a method to create an object by name (a new() that takes
  3492. > a Str255 as the parameter).  This is the ability that I'm trying to get.
  3493.  
  3494. What you're looking for is new_by_name.  See CDLOGDialog::AddOverloadedItem.
  3495. The NewClassDemo has some good examples.
  3496. --
  3497. -------------------------------------------------------------------
  3498.  Daryl Spitzer                    "Life isn't just, life just is."
  3499.  Vancouver, Canada                         -- Me  (I think.)
  3500.  Daryl_Spitzer@mindlink.bc.ca
  3501. -------------------------------------------------------------------
  3502. 
  3503. 
  3504. Path: ucivax!gateway
  3505. From: dnebing@andy.bgsu.edu ("Mr. Neb")
  3506. Subject: (none)
  3507. Message-ID: <9201302123.AA04234@andy.bgsu.edu>
  3508. Newsgroups: fa.think-c
  3509. Lines: 10
  3510. Date: 30 Jan 92 21:23:56 GMT
  3511.  
  3512.  
  3513.     Has anyone found a "nice" way to create a text editor without using
  3514. TextEdit?  I have been thinking about the problem for a few days; I have some
  3515. vague idea of how I _could_ get it to work if I tried, but I am not sure
  3516. about how to handle certain functions.
  3517.  
  3518.     Does anyone out there have a method that they might like to share?
  3519.  
  3520.     Thanks,
  3521.         Mr. Neb
  3522. 
  3523. 
  3524. Path: ucivax!gateway
  3525. From: dnebing@andy.bgsu.edu ("Mr. Neb")
  3526. Subject: (none)
  3527. Message-ID: <9201302125.AA04283@andy.bgsu.edu>
  3528. Newsgroups: fa.think-c
  3529. Lines: 1
  3530. Date: 30 Jan 92 21:25:20 GMT
  3531.  
  3532. please add dnebing@andy.bgsu.edu
  3533. 
  3534. 
  3535. Path: ucivax!gateway
  3536. From: cmiller@laurel (Craig Miller)
  3537. Subject: Re: The SPLAsh Story?
  3538. Message-ID: <9201311640.AA13524@laurel.umass.edu>
  3539. Newsgroups: fa.think-c
  3540. Lines: 94
  3541. Date: 31 Jan 92 16:38:29 GMT
  3542.  
  3543. Greg Dow of SPLAsh (Symantec Programming Languages Association) has
  3544. replied to my letter of concern over delays in receiving issues
  3545. of the SPLAsh journal.  These concerns were due to my own experience
  3546. and from comments made by others over the Think-c mailing list.
  3547. The following letter is posted with his permission.
  3548.  
  3549. -----------------------------------------------------------------------
  3550. Craig D. Miller, Computer Programmer          \  cmiller@math.umass.edu
  3551. Scientific Reasoning Research Institute (SRRI) \      tel. 413-545-5865
  3552. 306 Hasbrouck Lab                               \
  3553. University of Massachusetts, Amherst, MA  01003  \                  USA
  3554. -----------------------------------------------------------------------
  3555.  
  3556. From SPLASH@AppleLink.Apple.COM Wed Jan 29 06:53:09 1992
  3557. Message-Id: <696685082.3211952@AppleLink.Apple.COM>
  3558. Subject: Re: The SPLAsh Story?
  3559. To: CMILLER@MATH.umass.edu
  3560. From: SPLASH@AppleLink.Apple.COM (Symantec Programming Lang Assn,UG)
  3561. Date: 29 Jan 92 10:42 GMT
  3562.  
  3563. Craig,
  3564.  
  3565. The next issue of THINKin' CaP (Issue #4) is running behind schedule.
  3566. We are still completing and debugging the software for some of the
  3567. articles.
  3568. I apologize for the delay, but hope you can sympathize with the
  3569. difficulties
  3570. in getting software done on time. The issue should be in the mail by
  3571. the
  3572. end of February.
  3573.  
  3574. As a tangible form of apology, I will send you a complimentary copy of
  3575. the
  3576. Winter 1991 back issue. You will still receive four additional issues
  3577. on
  3578. your subscription, although it will probably take longer than one
  3579. year.
  3580. If this situation is not acceptable, notify me and I will issue you a
  3581. full refund.
  3582.  
  3583. You made a comment about hearing "stories of similar non-communication
  3584. via email." Do you mean that others have sent you e-mail about lack
  3585. of communication from SPLAsh? Or do you mean that others have said that
  3586. SPLAsh has not responded to e-mail messages? I do try to respond to all
  3587. e-mail messages, but sometimes mail bounces and I am left with no way
  3588. to communicate with the sender.
  3589.  
  3590. To answer your other questions:
  3591.  
  3592. Who are you?
  3593.   I am a self-employed Mac programmer.
  3594.  
  3595. What have you done?
  3596.   I wrote the original THINK Class Library under contract for
  3597.   Symantec.
  3598.  
  3599. What are you doing?
  3600.   I am working on a couple Mac programming projects; pieces of the code
  3601.   I write will appear in articles in the journal.
  3602.  
  3603.   I run the Programmers group at BMUG (a non-profit Mac users group
  3604.   in Berkeley, CA) and we have meetings every other week. This year, I
  3605.   am also Chairman of BMUG and I spend a couple hours each day
  3606.   overseeing
  3607.   the finances and operation of this group (which has 10,000 members
  3608.   and
  3609.   12 employees). All this work is as a volunteer.
  3610.  
  3611. What are your plans for the future of this association?
  3612.   I hope to get a better handle on things, so that I can produce the
  3613.   journal in a more timely fashion. I am running SPLAsh mostly as a
  3614.   service to programmers. I receive no salary or compensation from
  3615.   SPLAsh,
  3616.   and in fact invested a few thousand dollars of my own money to get
  3617.   the
  3618.   group started.
  3619.  
  3620.   Once the journal is under control, I'd like to explore other
  3621.   services,
  3622.   such as hosting conferences and conducting classes.
  3623.  
  3624.  
  3625. I understand your disappointment and can only ask for your patience. I
  3626. underestimated how difficult it was to produce a quarterly journal. I
  3627. am
  3628. not trying to cheat or swindle anyone. I believe I have fairly resolved
  3629. all complaints, either by sending free back issues or issuing full
  3630. refunds (with interest in some cases).
  3631.  
  3632. -- Greg Dow
  3633. -- SPLAsh
  3634.  
  3635.  
  3636.  
  3637. 
  3638. 
  3639. Path: ucivax!gateway
  3640. From: mead@vault.wustl.edu (Charles Mead)
  3641. Subject: SPLASH
  3642. Message-ID: <9201312017.AA06687@vault.wustl.edu>
  3643. Newsgroups: fa.think-c
  3644. Lines: 6
  3645. Date: 31 Jan 92 20:21:24 GMT
  3646.  
  3647.  
  3648. How does one sign up for Splash?  I read the response to Craig Miller's
  3649. note and feel that I'd like to be a part of this group, whether it publishes
  3650. on time or not.
  3651.  
  3652. charlie mead
  3653. 
  3654.